[PATCH 1/3] gitweb: blame: print commit-8 on the leading row of a commit-block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 gitweb/gitweb.perl |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a9e95c9..9518086 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2501,17 +2501,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";
-- 
1.4.2.1.ga68d6


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]