It's terribly annoying to have tons of Cargo.lock and Cargo.toml merge conflicts when rebasing pretty much any Rust PR on any large repo. It would be nice to have custom merge tools that automatically do the right thing here.
see "Defining a custom merge driver": https://git-scm.com/docs/gitattributes#_defining_a_custom_merge_driver
To add to this, NPM/Yarn have already implemented this feature officially.
cc #5831
I really like this feature, and enjoy it a lot in yarn.
So there are actually two different solutions here, and I think we should follow npm's lead and implement both:
Here are some references:
From reading the documentation/PRs linked in this ticket, I get the following understanding (please correct at any stage if I am wrong):
.git/config and .gitattributes.Thoughts?
If my understanding is correct, then I would start working on such a merge driver :)
Most helpful comment
From reading the documentation/PRs linked in this ticket, I get the following understanding (please correct at any stage if I am wrong):
.git/configand.gitattributes.If the custom merge driver is activated in a repository, cargo would practically never see a lock file with merge conflicts again, unless the driver fails to resolve the conflicts.
Thoughts?
If my understanding is correct, then I would start working on such a merge driver :)