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
nixpkgs manual: how to make a patch file with git #31778
Conversation
The text is good, but the placement is not quite right. |
Section 14.1 doesn't seem relevant to this; I'll move it to 13.5. |
I have not though about the best placement, I hope you'll chose right, but it seems appropriate for this to be a second level, not a third level section. Extending chapter 2 without creating a subsection also seems fine, because that chapter is a tutorial on adding packages, and this sometimes requires patching. |
This addresses NixOS#31684.
e06eaef
to
b43c5e0
Compare
Updated. I moved it into chapter 13 because I think it fits well alongside the discussion of when to commit patch files versus using I don't believe that Patches section really belongs under the "coding conventions" chapter, but I think that's a different conversation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, 13.4. Fetching Sources
and 13.5. Patches
hardly are Coding conventions
. I think this is ready to be merged.
Would it make sense to use |
The only effect of filterdiff on
Personally I've never bothered to remove them, and I'd prefer to keep the instructions simple. |
I'd be happy to change git diff > nixpkgs/pkgs/the/package/0001-changes.patch to nix-shell --pure --packages git patchutils --run "git diff | filterdiff --strip=0 --clean > nixpkgs/pkgs/the/package/0001-changes.patch" Not including extraneous information in the nixpkgs repo seems very desirable to me. The command is harder to understand, but in exchange you get a patch file that's easier to understand, so seems like a worthwhile tradeoff. |
I think the instructions as-is are great, and the extra complexity of filterdiff isn't worth the benefits for this use case. Whereas, fetchpatch uses filterdiff to keep stable patch contents (shasum) when upstreams sometimes change bits of metadata (which are filtered.) |
This addresses #31684.