Skip to content

Commit 7bb260f

Browse files
vdyemjcheetham
authored andcommitted
dist: archive HEAD instead of HEAD^{tree}
Update `git archive` tree-ish argument from `HEAD^{tree}` to `HEAD`. By using a commit (rather than tree) reference, the commit hash will be stored as an extended pax header, extractable git `git get-tar-commit-id`. The intended use-case for this change is building `git` from the output of `make dist` - in combination with the ability to specify a fallback `GIT_BUILT_FROM_COMMIT`, a user can extract the commit ID used to build the archive and set it as `GIT_BUILT_FROM_COMMIT`. The result is fully-populated information for the commit hash in `git version --build-options`. Signed-off-by: Victoria Dye <vdye@github.com>
1 parent af7f735 commit 7bb260f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3753,7 +3753,7 @@ dist: git-archive$(X) configure
37533753
@$(MAKE) -C git-gui TARDIR=../.dist-tmp-dir/git-gui dist-version
37543754
./git-archive --format=tar \
37553755
$(GIT_ARCHIVE_EXTRA_FILES) \
3756-
--prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
3756+
--prefix=$(GIT_TARNAME)/ HEAD > $(GIT_TARNAME).tar
37573757
@$(RM) -r .dist-tmp-dir
37583758
gzip -f -9 $(GIT_TARNAME).tar
37593759

0 commit comments

Comments
 (0)