gitweb: Change parse_commits signature to allow for multiple options
Change order of parameters in parse_commits() to have $filename before @args (extra options), to allow for multiple extra options, for example both '--grep=<pattern>' and '--fixed-strings'. Change all callers to follow new calling convention. Originally by Petr Baudis, in http://repo.or.cz/git/gitweb.git: b98f0a7c gitweb: Clearly distinguish regexp / exact match searches Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jakub Narebski committed
Feb 26, 2008 at 13:22 UTC
311e552e7674be620bd930ddada307c15140c6ac
1 file changed
+5
-5
gitweb/gitweb.perl
+5
-5
@@ -2079,7 +2079,7 @@ sub parse_commit {
2079
}
2080
2081
sub parse_commits {
2082
- my ($commit_id, $maxcount, $skip, $arg, $filename) = @_;
2082
+ my ($commit_id, $maxcount, $skip, $filename, @args) = @_;
2083
my @cos;
2084
2085
$maxcount ||= 1;
@@ -2089,7 +2089,7 @@ sub parse_commits {
2089
2090
open my $fd, "-|", git_cmd(), "rev-list",
2091
"--header",
2092
- ($arg ? ($arg) : ()),
2092
+ @args,
2093
("--max-count=" . $maxcount),
2094
("--skip=" . $skip),
2095
@extra_options,
@@ -5172,7 +5172,7 @@ sub git_history {
5172
$ftype = git_get_type($hash);
5173
}
5174
5175
- my @commitlist = parse_commits($hash_base, 101, (100 * $page), "--full-history", $file_name);
5175
+ my @commitlist = parse_commits($hash_base, 101, (100 * $page), $file_name, "--full-history");
5176
5177
my $paging_nav = '';
5178
if ($page > 0) {
@@ -5255,7 +5255,7 @@ sub git_search {
5255
$greptype = "--committer=";
5256
}
5257
$greptype .= $search_regexp;
5258
- my @commitlist = parse_commits($hash, 101, (100 * $page), $greptype);
5258
+ my @commitlist = parse_commits($hash, 101, (100 * $page), undef, $greptype);
5259
5260
my $paging_nav = '';
5261
if ($page > 0) {
@@ -5507,7 +5507,7 @@ sub git_feed {
5507
5508
# log/feed of current (HEAD) branch, log of given branch, history of file/directory
5509
my $head = $hash || 'HEAD';
5510
- my @commitlist = parse_commits($head, 150, 0, undef, $file_name);
5510
+ my @commitlist = parse_commits($head, 150, 0, $file_name);
5511
5512
my %latest_commit;
5513
my %latest_date;