summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 719dad2)
raw | patch | inline | side by side (parent: 719dad2)
author | Robert Fitzsimons <robfitz@273k.net> | |
Sun, 24 Dec 2006 14:31:46 +0000 (14:31 +0000) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 25 Dec 2006 18:40:43 +0000 (10:40 -0800) |
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 42b7449251bc155e3b0c2d494b009d3a300c7122..53dd2251db578fdf3faa5bafeadbebcf8f83c144 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
}
sub git_search_grep_body {
- my ($greplist, $from, $to, $extra) = @_;
+ my ($commitlist, $from, $to, $extra) = @_;
$from = 0 unless defined $from;
- $to = $#{$greplist} if (!defined $to || $#{$greplist} < $to);
+ $to = $#{$commitlist} if (!defined $to || $#{$commitlist} < $to);
print "<table class=\"grep\" cellspacing=\"0\">\n";
my $alternate = 1;
for (my $i = $from; $i <= $to; $i++) {
- my $commit = $greplist->[$i];
- my %co = parse_commit($commit);
+ my %co = %{$commitlist->[$i]};
if (!%co) {
next;
}
+ my $commit = $co{'id'};
if ($alternate) {
print "<tr class=\"dark\">\n";
} else {
} elsif ($searchtype eq 'committer') {
$greptype = "--committer=";
}
- open my $fd, "-|", git_cmd(), "rev-list",
- ("--max-count=" . (100 * ($page+1))),
- ($greptype . $searchtext),
- $hash, "--"
- or next;
- my @revlist = map { chomp; $_ } <$fd>;
- close $fd;
+ $greptype .= $searchtext;
+ my @commitlist = parse_commits($hash, 101, (100 * $page), $greptype);
my $paging_nav = '';
if ($page > 0) {
$paging_nav .= "first";
$paging_nav .= " ⋅ prev";
}
- if ($#revlist >= (100 * ($page+1)-1)) {
+ if ($#commitlist >= 100) {
$paging_nav .= " ⋅ " .
$cgi->a({-href => href(action=>"search", hash=>$hash,
searchtext=>$searchtext, searchtype=>$searchtype,
$paging_nav .= " ⋅ next";
}
my $next_link = '';
- if ($#revlist >= (100 * ($page+1)-1)) {
+ if ($#commitlist >= 100) {
$next_link =
$cgi->a({-href => href(action=>"search", hash=>$hash,
searchtext=>$searchtext, searchtype=>$searchtype,
git_print_page_nav('','', $hash,$co{'tree'},$hash, $paging_nav);
git_print_header_div('commit', esc_html($co{'title'}), $hash);
- git_search_grep_body(\@revlist, ($page * 100), $#revlist, $next_link);
+ git_search_grep_body(\@commitlist, 0, 99, $next_link);
}
if ($searchtype eq 'pickaxe') {