@matheusbsbs / matheus-bagliano / commits / 9ccb64c8e0
Fork 0

tar-tree deprecation: we eat our own dog food.

It is silly to keep using git-tar-tree in dist target when the command gives a big deprecation warning when called. Instead, use "git-archive --format=tar" which we recommend to our users. Update gitweb's snapshot feature to use git-archive for the same reason. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Oct 5, 2006 at 02:26 UTC 9ccb64c8e0791a865ad520bcfff4b02cc7c50097
2 files changed +9 -5
Makefile
+3 -2
@@ -856,8 +856,9 @@ git.spec: git.spec.in
856 mv $@+ $@
857
858 GIT_TARNAME=git-$(GIT_VERSION)
859 -dist: git.spec git-tar-tree
860 - ./git-tar-tree HEAD^{tree} $(GIT_TARNAME) > $(GIT_TARNAME).tar
859 +dist: git.spec git-archive
860 + ./git-archive --format=tar \
861 + --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
862 @mkdir -p $(GIT_TARNAME)
863 @cp git.spec $(GIT_TARNAME)
864 @echo $(GIT_VERSION) > $(GIT_TARNAME)/version
gitweb/gitweb.perl
+6 -3
@@ -2838,9 +2838,12 @@ sub git_snapshot {
2838 -content_disposition => 'inline; filename="' . "$filename" . '"',
2839 -status => '200 OK');
2840
2841 - my $git_command = git_cmd_str();
2842 - open my $fd, "-|", "$git_command tar-tree $hash \'$project\' | $command" or
2843 - die_error(undef, "Execute git-tar-tree failed.");
2841 + my $git = git_cmd_str();
2842 + my $name = $project;
2843 + $name =~ s/\047/\047\\\047\047/g;
2844 + open my $fd, "-|",
2845 + "$git archive --format=tar --prefix=\'$name\'/ $hash | $command"
2846 + or die_error(undef, "Execute git-tar-tree failed.");
2847 binmode STDOUT, ':raw';
2848 print <$fd>;
2849 binmode STDOUT, ':utf8'; # as set at the beginning of gitweb.cgi