Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitweb: Change log action to use parse_commits.
author
Robert Fitzsimons
<robfitz@273k.net>
Sun, 24 Dec 2006 14:31:45 +0000
(14:31 +0000)
committer
Junio C Hamano
<junkio@cox.net>
Mon, 25 Dec 2006 18:40:43 +0000
(10:40 -0800)
Also add missing next link to bottom of page.
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
190d7fd
)
diff --git
a/gitweb/gitweb.perl
b/gitweb/gitweb.perl
index 5f1ace98aaf8a32a1dc8b7784b779d504922bc6d..42b7449251bc155e3b0c2d494b009d3a300c7122 100755
(executable)
--- a/
gitweb/gitweb.perl
+++ b/
gitweb/gitweb.perl
@@
-3645,28
+3645,25
@@
sub git_log {
}
my $refs = git_get_references();
}
my $refs = git_get_references();
- my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
- open my $fd, "-|", git_cmd(), "rev-list", $limit, $hash, "--"
- or die_error(undef, "Open git-rev-list failed");
- my @revlist = map { chomp; $_ } <$fd>;
- close $fd;
+ my @commitlist = parse_commits($hash, 101, (100 * $page));
- my $paging_nav = format_paging_nav('log', $hash, $head, $page,
$#revlist
);
+ my $paging_nav = format_paging_nav('log', $hash, $head, $page,
(100 * ($page+1))
);
git_header_html();
git_print_page_nav('log','', $hash,undef,undef, $paging_nav);
git_header_html();
git_print_page_nav('log','', $hash,undef,undef, $paging_nav);
- if (!@
rev
list) {
+ if (!@
commit
list) {
my %co = parse_commit($hash);
git_print_header_div('summary', $project);
print "<div class=\"page_body\"> Last change $co{'age_string'}.<br/><br/></div>\n";
}
my %co = parse_commit($hash);
git_print_header_div('summary', $project);
print "<div class=\"page_body\"> Last change $co{'age_string'}.<br/><br/></div>\n";
}
- for (my $i = ($page * 100); $i <= $#revlist; $i++) {
- my $commit = $revlist[$i];
- my $ref = format_ref_marker($refs, $commit);
- my %co = parse_commit($commit);
+ my $to = ($#commitlist >= 99) ? (99) : ($#commitlist);
+ for (my $i = 0; $i <= $to; $i++) {
+ my %co = %{$commitlist[$i]};
next if !%co;
next if !%co;
+ my $commit = $co{'id'};
+ my $ref = format_ref_marker($refs, $commit);
my %ad = parse_date($co{'author_epoch'});
git_print_header_div('commit',
"<span class=\"age\">$co{'age_string'}</span>" .
my %ad = parse_date($co{'author_epoch'});
git_print_header_div('commit',
"<span class=\"age\">$co{'age_string'}</span>" .
@@
-3688,6
+3685,12
@@
sub git_log {
git_print_log($co{'comment'}, -final_empty_line=> 1);
print "</div>\n";
}
git_print_log($co{'comment'}, -final_empty_line=> 1);
print "</div>\n";
}
+ if ($#commitlist >= 100) {
+ print "<div class=\"page_nav\">\n";
+ print $cgi->a({-href => href(action=>"log", hash=>$hash, page=>$page+1),
+ -accesskey => "n", -title => "Alt-n"}, "next");
+ print "</div>\n";
+ }
git_footer_html();
}
git_footer_html();
}