Extend nix-prefetch-git to support passing tree hashes as "rev"#104714
Extend nix-prefetch-git to support passing tree hashes as "rev"#104714taku0 merged 1 commit intoNixOS:masterfrom
Conversation
|
@jonringer it looks like you were the last person to commit to this file, I hope you don't mind being tagged. Do you by any chance know who might be the best person to provide feedback on this? Interested in getting this change merged. |
|
Please squash commits and rename to |
babf18f to
81a58ae
Compare
|
Done! Also rebased on master |
81a58ae to
6779902
Compare
|
Just checking in, is this ready to be merged? |
Since NixOS#104714 using a tag as the `rev` parameter to `fetchgit` is no longer reliable, so spell out the rev. Fixes NixOS#114439
|
FYI: This caused a regression that isn't the fault of this PR but it now becomes apparent that (Just to link that issue here in case anyone else runs into that and finds this PR.) |
|
Thanks @primeos. For completeness, there have been a couple other issues mentioning regressions: I'm not sure what the best fix is. We could revert this if it's causing major problems. FWIW, we could restore the old behavior by handling the |
Motivation for this change
I'm working on Julia packages in Nix. Julia's package manager organizes its dependencies a
Manifest.tomlfile, which is almost perfect to use with Nix because it contains Git hashes we can pull out and pass tofetchgit. However, Julia uses Git tree hashes rather than commit hashes; see here.It would be convenient if
fetchgitcould understand tree hashes when they're passed as therevargument. It seems straightforward to support, as this PR shows.I've tested this with my prototype Julia packaging tool and it works. If this could be accepted then I'd be happy to update the documentation and stuff. Thanks!
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)