3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/build-support/fetchgit
Bjørn Forsman 53614cf1a7 nix-prefetch-git: fix determinism with leaveDotGit
Add more files to the delete list:

 * .git/FETCH_HEAD
 * .git/ORIG_HEAD
 * .git/refs/remotes/origin/HEAD
 * .git/config

Further, remove all remote branches, remove tags not reachable from the
given 'rev', do a full repack and then garbage collect unreferenced
objects.

According to my testing, the result is fully deterministic. As in "any
change done to the upstream repo, ahead of 'rev', will not affect the
hash of the resulting 'clone'". Even changing the clone URL will not
change the output hash, because .git/config is removed.

A new version of git can of course change store format, but that's
unavoidable.

For big repositories, the repack operation may be a bit heavy. But as
far as I can see there is no cheaper way to determinism.
2014-11-02 13:15:33 +01:00
..
builder.sh fetchgit: Implement option to not check out submodules. 2014-03-25 20:03:55 +01:00
default.nix Allow git checkouts to have custom name 2014-09-03 21:54:25 +04:00
nix-prefetch-git nix-prefetch-git: fix determinism with leaveDotGit 2014-11-02 13:15:33 +01:00
private.nix Separate fetchgitPrivate into a separate file 2014-07-16 18:05:56 -04:00