-
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
fetchpatch2
allows lengths of commit hashes to change
#257446
Comments
Git auto scales the commit length depending on the amount of commits so that should be the issue https://github.com/orgs/community/discussions/12531
|
Yes. That may very well be the cause for the change in the original generated patch.
But regardless of _why_, there are arbitrarily shortened commit hashes in the "normalized" output patch, that, as far as I can tell, have no meaning for the application of the patch. _That_ should be fixed.
I am not sure in whose "responsibility" that falls. nixpkgs or patchutils?
---
Or I suppose we could reply on this (community/community#12531 (comment)):
It seems like there is already an undocumented option: `?full_index=1`
But that we should then ... somehow make sure that nix users/uses actually use (automatically/documentation/?).
|
4 tasks
There is another workaround in anduril/jetpack-nixos@8bf417e#diff-79b35d81aae8a2f44ce607ad52c948baa40a3cd4b6532e6a2af14b708d31f8f7 as mentioned in #266556 |
13 tasks
Yes, that probably works as well.
I'd be inclined to have the fetcher do both, add the URL parameter (pre-fetch) and filter the lines.
That way, for the output hah to change, it would take GitHub changing that aspect of the patch generation (e.g. doing that undocumented flag) _and_ us missing something in the filter.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The point of
fetchpatch
andfetchpatch2
is to prevent changes in API-generated patches that don't affect the patched tree from affecting the hash of the fetched patch.GitHub dynamically chooses the length of abbreviated commit hashes in a number of places, and (I guess) also in the generated patches.
Some time around August, a commit hash in the following patch changed from
5d7ffe2d91910
to5d7ffe2d91910a
.Old patch output
I still had that file in a local store. The new output is identical, except it uses
5d7ffe2d91910a
as the commit hash.Steps To Reproduce
That's difficult, since GitHub does not provide the old patch file anymore.
I assume the only difference in the patch files was exactly that hash.
Expected behavior
Stable output by
fetchpatch
andfetchpatch2
.fetchpatch2
is fairly new and hardly used innixpkgs
. Maybe it should be updated to normalize/strip the hashes? Or we get afetchpatch3
...Notify maintainers
@Artturin
The text was updated successfully, but these errors were encountered: