Skip to content

Commit

Permalink
gitweb: blame: print commit-8 on the leading row of a commit-block
Browse files Browse the repository at this point in the history
Print commit-8 only on the first, leading row of
a commit block, to complement the per-commit block coloring.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Luben Tuikov authored and Junio C Hamano committed Oct 4, 2006
1 parent 9074484 commit 9dc5f8c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -2495,17 +2495,23 @@ sub git_blame2 {
my $rev = substr($full_rev, 0, 8);
my $lineno = $2;
my $data = $3;
my $print_c8 = 0;

if (!defined $last_rev) {
$last_rev = $full_rev;
$print_c8 = 1;
} elsif ($last_rev ne $full_rev) {
$last_rev = $full_rev;
$current_color = ++$current_color % $num_colors;
$print_c8 = 1;
}
print "<tr class=\"$rev_color[$current_color]\">\n";
print "<td class=\"sha1\">" .
$cgi->a({-href => href(action=>"commit", hash=>$full_rev, file_name=>$file_name)},
esc_html($rev)) . "</td>\n";
print "<td class=\"sha1\">";
if ($print_c8 == 1) {
print $cgi->a({-href => href(action=>"commit", hash=>$full_rev, file_name=>$file_name)},
esc_html($rev));
}
print "</td>\n";
print "<td class=\"linenr\"><a id=\"l$lineno\" href=\"#l$lineno\" class=\"linenr\">" .
esc_html($lineno) . "</a></td>\n";
print "<td class=\"pre\">" . esc_html($data) . "</td>\n";
Expand Down

0 comments on commit 9dc5f8c

Please sign in to comment.