gitweb: blame: print commit-8 on the leading row of a commit-block
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>
Luben Tuikov committed
Oct 4, 2006 at 00:12 UTC
9dc5f8c9c2a10f77ecfa448c93da6ceec759df73
1 file changed
+9
-3
gitweb/gitweb.perl
+9
-3
@@ -2495,17 +2495,23 @@ HTML
2495
my $rev = substr($full_rev, 0, 8);
2496
my $lineno = $2;
2497
my $data = $3;
2498
+ my $print_c8 = 0;
2499
2500
if (!defined $last_rev) {
2501
$last_rev = $full_rev;
2502
+ $print_c8 = 1;
2503
} elsif ($last_rev ne $full_rev) {
2504
$last_rev = $full_rev;
2505
$current_color = ++$current_color % $num_colors;
2506
+ $print_c8 = 1;
2507
}
2508
print "<tr class=\"$rev_color[$current_color]\">\n";
2506
- print "<td class=\"sha1\">" .
2507
- $cgi->a({-href => href(action=>"commit", hash=>$full_rev, file_name=>$file_name)},
2508
- esc_html($rev)) . "</td>\n";
2509
+ print "<td class=\"sha1\">";
2510
+ if ($print_c8 == 1) {
2511
+ print $cgi->a({-href => href(action=>"commit", hash=>$full_rev, file_name=>$file_name)},
2512
+ esc_html($rev));
2513
+ }
2514
+ print "</td>\n";
2515
print "<td class=\"linenr\"><a id=\"l$lineno\" href=\"#l$lineno\" class=\"linenr\">" .
2516
esc_html($lineno) . "</a></td>\n";
2517
print "<td class=\"pre\">" . esc_html($data) . "</td>\n";