Skip to content

Commit

Permalink
tar-tree deprecation: we eat our own dog food.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Oct 5, 2006
1 parent 6030649 commit 9ccb64c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -856,8 +856,9 @@ git.spec: git.spec.in
mv $@+ $@

GIT_TARNAME=git-$(GIT_VERSION)
dist: git.spec git-tar-tree
./git-tar-tree HEAD^{tree} $(GIT_TARNAME) > $(GIT_TARNAME).tar
dist: git.spec git-archive
./git-archive --format=tar \
--prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
@mkdir -p $(GIT_TARNAME)
@cp git.spec $(GIT_TARNAME)
@echo $(GIT_VERSION) > $(GIT_TARNAME)/version
Expand Down
9 changes: 6 additions & 3 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -2838,9 +2838,12 @@ sub git_snapshot {
-content_disposition => 'inline; filename="' . "$filename" . '"',
-status => '200 OK');

my $git_command = git_cmd_str();
open my $fd, "-|", "$git_command tar-tree $hash \'$project\' | $command" or
die_error(undef, "Execute git-tar-tree failed.");
my $git = git_cmd_str();
my $name = $project;
$name =~ s/\047/\047\\\047\047/g;
open my $fd, "-|",
"$git archive --format=tar --prefix=\'$name\'/ $hash | $command"
or die_error(undef, "Execute git-tar-tree failed.");
binmode STDOUT, ':raw';
print <$fd>;
binmode STDOUT, ':utf8'; # as set at the beginning of gitweb.cgi
Expand Down

0 comments on commit 9ccb64c

Please sign in to comment.