lkml.org 
[lkml]   [2011]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[Git] partial downloading feature
From
Date
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'}});
}

\
 
 \ /
  Last update: 2011-10-14 14:39    [W:0.024 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site