gitweb: Change summary, shortlog actions to use parse_commits.
Also added missing accesskey. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Robert Fitzsimons committed
Dec 24, 2006 at 14:31 UTC
190d7fdcf325bb444fa806f09ebbb403a4ae4ee6
1 file changed
+12
-22
gitweb/gitweb.perl
+12
-22
@@ -2704,20 +2704,19 @@ sub git_project_list_body {
2704
2705
sub git_shortlog_body {
2706
# uses global variable $project
2707
- my ($revlist, $from, $to, $refs, $extra) = @_;
2707
+ my ($commitlist, $from, $to, $refs, $extra) = @_;
2708
2709
my $have_snapshot = gitweb_have_snapshot();
2710
2711
$from = 0 unless defined $from;
2712
- $to = $#{$revlist} if (!defined $to || $#{$revlist} < $to);
2712
+ $to = $#{$commitlist} if (!defined $to || $#{$commitlist} < $to);
2713
2714
print "<table class=\"shortlog\" cellspacing=\"0\">\n";
2715
my $alternate = 1;
2716
for (my $i = $from; $i <= $to; $i++) {
2717
- my $commit = $revlist->[$i];
2718
- #my $ref = defined $refs ? format_ref_marker($refs, $commit) : '';
2717
+ my %co = %{$commitlist->[$i]};
2718
+ my $commit = $co{'id'};
2719
my $ref = format_ref_marker($refs, $commit);
2720
- my %co = parse_commit($commit);
2720
if ($alternate) {
2721
print "<tr class=\"dark\">\n";
2722
} else {
@@ -3081,14 +3080,10 @@ sub git_summary {
3080
3081
# we need to request one more than 16 (0..15) to check if
3082
# those 16 are all
3084
- open my $fd, "-|", git_cmd(), "rev-list", "--max-count=17",
3085
- $head, "--"
3086
- or die_error(undef, "Open git-rev-list failed");
3087
- my @revlist = map { chomp; $_ } <$fd>;
3088
- close $fd;
3083
+ my @commitlist = parse_commits($head, 17);
3084
git_print_header_div('shortlog');
3090
- git_shortlog_body(\@revlist, 0, 15, $refs,
3091
- $#revlist <= 15 ? undef :
3085
+ git_shortlog_body(\@commitlist, 0, 15, $refs,
3086
+ $#commitlist <= 15 ? undef :
3087
$cgi->a({-href => href(action=>"shortlog")}, "..."));
3088
3089
if (@taglist) {
@@ -4456,26 +4451,21 @@ sub git_shortlog {
4451
}
4452
my $refs = git_get_references();
4453
4459
- my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
4460
- open my $fd, "-|", git_cmd(), "rev-list", $limit, $hash, "--"
4461
- or die_error(undef, "Open git-rev-list failed");
4462
- my @revlist = map { chomp; $_ } <$fd>;
4463
- close $fd;
4454
+ my @commitlist = parse_commits($head, 101, (100 * $page));
4455
4465
- my $paging_nav = format_paging_nav('shortlog', $hash, $head, $page, $#revlist);
4456
+ my $paging_nav = format_paging_nav('shortlog', $hash, $head, $page, (100 * ($page+1)));
4457
my $next_link = '';
4467
- if ($#revlist >= (100 * ($page+1)-1)) {
4458
+ if ($#commitlist >= 100) {
4459
$next_link =
4460
$cgi->a({-href => href(action=>"shortlog", hash=>$hash, page=>$page+1),
4470
- -title => "Alt-n"}, "next");
4461
+ -accesskey => "n", -title => "Alt-n"}, "next");
4462
}
4463
4473
-
4464
git_header_html();
4465
git_print_page_nav('shortlog','', $hash,$hash,$hash, $paging_nav);
4466
git_print_header_div('summary', $project);
4467
4478
- git_shortlog_body(\@revlist, ($page * 100), $#revlist, $refs, $next_link);
4468
+ git_shortlog_body(\@commitlist, 0, 99, $refs, $next_link);
4469
4470
git_footer_html();
4471
}