Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitweb: Change history action to use parse_commits.
author
Robert Fitzsimons
<robfitz@273k.net>
Sun, 24 Dec 2006 14:31:48 +0000
(14:31 +0000)
committer
Junio C Hamano
<junkio@cox.net>
Mon, 25 Dec 2006 18:40:44 +0000
(10:40 -0800)
Also added missing accesskey.
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:
b6093a5
)
diff --git
a/gitweb/gitweb.perl
b/gitweb/gitweb.perl
index f752a6f605dcd39fbdac5f2c14b4c3b03383ce00..f9994d941740107855dc49b7276619193dd20a90 100755
(executable)
--- a/
gitweb/gitweb.perl
+++ b/
gitweb/gitweb.perl
@@
-2750,23
+2750,19
@@
sub git_shortlog_body {
sub git_history_body {
# Warning: assumes constant type (blob or tree) during history
sub git_history_body {
# Warning: assumes constant type (blob or tree) during history
- my ($
rev
list, $from, $to, $refs, $hash_base, $ftype, $extra) = @_;
+ my ($
commit
list, $from, $to, $refs, $hash_base, $ftype, $extra) = @_;
$from = 0 unless defined $from;
$from = 0 unless defined $from;
- $to = $#{$
revlist} unless (defined $to && $to <= $#{$rev
list});
+ $to = $#{$
commitlist} unless (defined $to && $to <= $#{$commit
list});
print "<table class=\"history\" cellspacing=\"0\">\n";
my $alternate = 1;
for (my $i = $from; $i <= $to; $i++) {
print "<table class=\"history\" cellspacing=\"0\">\n";
my $alternate = 1;
for (my $i = $from; $i <= $to; $i++) {
- if ($revlist->[$i] !~ m/^([0-9a-fA-F]{40})/) {
- next;
- }
-
- my $commit = $1;
- my %co = parse_commit($commit);
+ my %co = %{$commitlist->[$i]};
if (!%co) {
next;
}
if (!%co) {
next;
}
+ my $commit = $co{'id'};
my $ref = format_ref_marker($refs, $commit);
my $ref = format_ref_marker($refs, $commit);
@@
-4219,12
+4215,7
@@
sub git_history {
$ftype = git_get_type($hash);
}
$ftype = git_get_type($hash);
}
- open my $fd, "-|",
- git_cmd(), "rev-list", $limit, "--full-history", $hash_base, "--", $file_name
- or die_error(undef, "Open git-rev-list-failed");
- my @revlist = map { chomp; $_ } <$fd>;
- close $fd
- or die_error(undef, "Reading git-rev-list failed");
+ my @commitlist = parse_commits($hash_base, 101, (100 * $page), "--full-history", $file_name);
my $paging_nav = '';
if ($page > 0) {
my $paging_nav = '';
if ($page > 0) {
@@
-4240,7
+4231,7
@@
sub git_history {
$paging_nav .= "first";
$paging_nav .= " ⋅ prev";
}
$paging_nav .= "first";
$paging_nav .= " ⋅ prev";
}
- if ($#
revlist >= (100 * ($page+1)-1)
) {
+ if ($#
commitlist >= 100
) {
$paging_nav .= " ⋅ " .
$cgi->a({-href => href(action=>"history", hash=>$hash, hash_base=>$hash_base,
file_name=>$file_name, page=>$page+1),
$paging_nav .= " ⋅ " .
$cgi->a({-href => href(action=>"history", hash=>$hash, hash_base=>$hash_base,
file_name=>$file_name, page=>$page+1),
@@
-4249,11
+4240,11
@@
sub git_history {
$paging_nav .= " ⋅ next";
}
my $next_link = '';
$paging_nav .= " ⋅ next";
}
my $next_link = '';
- if ($#
revlist >= (100 * ($page+1)-1)
) {
+ if ($#
commitlist >= 100
) {
$next_link =
$cgi->a({-href => href(action=>"history", hash=>$hash, hash_base=>$hash_base,
file_name=>$file_name, page=>$page+1),
$next_link =
$cgi->a({-href => href(action=>"history", hash=>$hash, hash_base=>$hash_base,
file_name=>$file_name, page=>$page+1),
- -title => "Alt-n"}, "next");
+ -
accesskey => "n", -
title => "Alt-n"}, "next");
}
git_header_html();
}
git_header_html();
@@
-4261,7
+4252,7
@@
sub git_history {
git_print_header_div('commit', esc_html($co{'title'}), $hash_base);
git_print_page_path($file_name, $ftype, $hash_base);
git_print_header_div('commit', esc_html($co{'title'}), $hash_base);
git_print_page_path($file_name, $ftype, $hash_base);
- git_history_body(\@
revlist, ($page * 100), $#revlist
,
+ git_history_body(\@
commitlist, 0, 99
,
$refs, $hash_base, $ftype, $next_link);
git_footer_html();
$refs, $hash_base, $ftype, $next_link);
git_footer_html();