diff options
author | René Scharfe <l.s.r@web.de> | 2020-09-19 23:23:50 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-20 00:56:06 +0200 |
commit | df368fae35ce23f5b373cd567595063997bdb61c (patch) | |
tree | 1fb15f19b0063af1f31d2a38381a62625784a3b9 | |
parent | archive: add --add-file (diff) | |
download | git-df368fae35ce23f5b373cd567595063997bdb61c.tar.xz git-df368fae35ce23f5b373cd567595063997bdb61c.zip |
Makefile: use git-archive --add-file
Add untracked files for the dist target directly using git archive
instead of calling tar cr to append them. This reduces the dependency
on external tools and gives the untracked files the same access times
and user information as tracked ones, integrating them seamlessly.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | Makefile | 41 |
1 files changed, 19 insertions, 22 deletions
@@ -3045,32 +3045,29 @@ quick-install-html: # With GNU tar, "--mode=u+rwX,og+rX,og-w" would be a good idea, for example. TAR_DIST_EXTRA_OPTS = GIT_TARNAME = git-$(GIT_VERSION) +GIT_ARCHIVE_EXTRA_FILES = \ + --prefix=$(GIT_TARNAME)/ \ + --add-file=configure \ + --add-file=$(GIT_TARNAME)/version \ + --prefix=$(GIT_TARNAME)/git-gui/ \ + --add-file=$(GIT_TARNAME)/git-gui/version +ifdef DC_SHA1_SUBMODULE +GIT_ARCHIVE_EXTRA_FILES += \ + --prefix=$(GIT_TARNAME)/sha1collisiondetection/ \ + --add-file=sha1collisiondetection/LICENSE.txt \ + --prefix=$(GIT_TARNAME)/sha1collisiondetection/lib/ \ + --add-file=sha1collisiondetection/lib/sha1.c \ + --add-file=sha1collisiondetection/lib/sha1.h \ + --add-file=sha1collisiondetection/lib/ubc_check.c \ + --add-file=sha1collisiondetection/lib/ubc_check.h +endif dist: git-archive$(X) configure - ./git-archive --format=tar \ - --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar @mkdir -p $(GIT_TARNAME) - @cp configure $(GIT_TARNAME) @echo $(GIT_VERSION) > $(GIT_TARNAME)/version @$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version - $(TAR) rf $(GIT_TARNAME).tar $(TAR_DIST_EXTRA_OPTS) \ - $(GIT_TARNAME)/configure \ - $(GIT_TARNAME)/version \ - $(GIT_TARNAME)/git-gui/version -ifdef DC_SHA1_SUBMODULE - @mkdir -p $(GIT_TARNAME)/sha1collisiondetection/lib - @cp sha1collisiondetection/LICENSE.txt \ - $(GIT_TARNAME)/sha1collisiondetection/ - @cp sha1collisiondetection/LICENSE.txt \ - $(GIT_TARNAME)/sha1collisiondetection/ - @cp sha1collisiondetection/lib/sha1.[ch] \ - $(GIT_TARNAME)/sha1collisiondetection/lib/ - @cp sha1collisiondetection/lib/ubc_check.[ch] \ - $(GIT_TARNAME)/sha1collisiondetection/lib/ - $(TAR) rf $(GIT_TARNAME).tar $(TAR_DIST_EXTRA_OPTS) \ - $(GIT_TARNAME)/sha1collisiondetection/LICENSE.txt \ - $(GIT_TARNAME)/sha1collisiondetection/lib/sha1.[ch] \ - $(GIT_TARNAME)/sha1collisiondetection/lib/ubc_check.[ch] -endif + ./git-archive --format=tar \ + $(GIT_ARCHIVE_EXTRA_FILES) \ + --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar @$(RM) -r $(GIT_TARNAME) gzip -f -9 $(GIT_TARNAME).tar |