Messages in this thread Patch in this message | | | Subject | [Git] partial downloading feature | From | Tetsuo Handa <> | Date | Fri, 14 Oct 2011 21:37:43 +0900 |
| |
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'}}); }
| |