]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: blame: print commit-8 on the leading row of a commit-block
authorLuben Tuikov <redacted>
Wed, 4 Oct 2006 07:12:17 +0000 (00:12 -0700)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:10 +0000 (00:07 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 245545a685925f1aa57eaf4630ad711137e89be504ba2c0d3b694a1da6b03e8a..5688f76be3634029cf96379f8a3b50d2b6c51b402c0a5d3f484c98a617563d69 100755 (executable)
@@ -2515,17 +2515,23 @@ HTML
                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";
This page took 0.027666 seconds and 4 git commands to generate.