git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luben Tuikov <ltuikov@yahoo.com>
To: git@vger.kernel.org
Subject: [PATCH 1/3] gitweb: blame: print commit-8 on the leading row of a commit-block
Date: Wed, 4 Oct 2006 00:12:17 -0700 (PDT)	[thread overview]
Message-ID: <20061004071217.36209.qmail@web31804.mail.mud.yahoo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

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>
---
 gitweb/gitweb.perl |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 1207600725-p1.txt --]
[-- Type: text/inline; name="p1.txt", Size: 1113 bytes --]

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


                 reply	other threads:[~2006-10-04  7:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061004071217.36209.qmail@web31804.mail.mud.yahoo.com \
    --to=ltuikov@yahoo.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).