-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
How to resolve formatting-related conflicts #395247
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
Comments
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nix-formatting-team-full-nixpkgs-reformat/61867/3 |
Might be good to mention that the cloned nixpkgs's I kept on running into conflict issues and didn't realize that I had to update my clone's |
I run into this a bunch:
|
I have made good experiences with mergiraf. When nothing else worked to resolve merge conflicts (including formatting-related) in a PR here, mergiraf resolved everything in the background without breaking a sweat. Maybe worth mentioning here. |
Uh oh!
There was an error while loading. Please reload this page.
With #380990 (and #395018 on the release branch), there will be a lot of merge conflicts related to formatting (see the announcement for more context). Here are the options for resolving them more easily
Method 1: Auto-rebase script
You can use the new auto-rebase script. This takes some time to run (especially if you have a lot of commits in your PR), but should take care of rebasing the current branch while automatically resolving any merge conflicts caused by the full Nixpkgs reformat:
Method 2:
git mergetool
Warning
This method has a bug (see NixOS/nixfmt#291 for the fix, though it will take some time for it to be propagated) that can affect merge correctness. As such, it is not recommended right now. If you use it regardless, make sure to double-check the result for correctness.
Instructions
Nixfmt newly provides a mode usable by
git mergetool
that is faster and more general than the above, and allows resolving almost all formatting-related conflicts automatically.There's more extensive docs, but the most basic way to use it is as follows:
The text was updated successfully, but these errors were encountered: