[Git] partial downloading feature

From: Tetsuo Handa
Date: Fri Oct 14 2011 - 08:37:51 EST


Hello.

Is there any chance to add support for "[path...]" argument of git-archive
command to gitweb.cgi interface (something like below untested patch) ?

I sometimes download kernel source from snapshot links on
http://git.kernel.org/?p=linux/kernel/git/next/linux-next-history.git;a=summary
but I don't need 100MB tarball when wanting to download a single subdirectory.

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 85d64b2..aedf11e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -754,6 +754,7 @@ our @cgi_param_mapping = (
searchtext => "s",
searchtype => "st",
snapshot_format => "sf",
+ snapshot_subdir => "ss",
extra_options => "opt",
search_use_regexp => "sr",
ctag => "by_tag",
@@ -6681,7 +6682,7 @@ sub git_snapshot {
my $cmd = quote_command(
git_cmd(), 'archive',
"--format=$known_snapshot_formats{$format}{'format'}",
- "--prefix=$prefix/", $hash);
+ "--prefix=$prefix/", $hash, $snapshot_subdir);
if (exists $known_snapshot_formats{$format}{'compressor'}) {
$cmd .= ' | ' . quote_command(@{$known_snapshot_formats{$format}{'compressor'}});
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/