-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a custom Git merge tool for Cargo.locks and Cargo.tomls #1818
Comments
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):
Thoughts? |
It's unfortunate you only got reactions for this and not a real response, @thomaseizinger.
I can confirm this from experience. Here's an example from npm:
Sounds like standard practice in Rust-land.
Right. Emphasis on "unless". I don't expect this to always be able to resolve them.
That would be super sweet. |
Thanks @mightyiam ! I have to admit, this was no longer on my radar at all. The latest lockfile version only rarely produces conflicts in my experience. For Cargo.toml, I am not sure we can automatically resolve conflicts at all? |
I haven't thought this through. I hope some smart people will! |
In case anyone else wants context on this, #7070 changed the lockfile to make it produce fewer conflicts |
Note that https://github.com/relrelb/cargo-merge-driver exists, which seems to work (though it could maybe do with some updating of e.g. the beta Edit: updated deps and README at https://github.com/afranchuk/cargo-merge-driver |
@afranchuk sadly, that's not a real merge driver, just a hack that always updates all packages to their latest versions. A real merger should parse all lock files, identify the changes and merge them roughly according to these rules:
Also FYI I made a merge tool to resolve |
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.
The text was updated successfully, but these errors were encountered: