From a6be48b958bdc34bf36112e501613062b3d1a79f Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Fri, 10 Jul 2009 23:55:44 +0200 Subject: [PATCH] gitweb: Mark boundary commits in 'blame' view Use "boundary" class to mark boundary commits, which currently results in using bold weight font for SHA-1 of a commit (to be more exact for all text in the cell that contains SHA-1 of a commit). Detecting boundary commits is done by watching for "boundary" header in "git blame -p" output. Because this header doesn't carry additional data the regular expression for blame header fields had to be adjusted. With current gitweb API only root (parentless) commits can be boundary commits. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- gitweb/gitweb.css | 4 ++++ gitweb/gitweb.perl | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css index d05bc37646..5e2f629ffb 100644 --- a/gitweb/gitweb.css +++ b/gitweb/gitweb.css @@ -242,6 +242,10 @@ tr.dark:hover { background-color: #edece6; } +tr.boundary td.sha1 { + font-weight: bold; +} + td { padding: 2px 5px; font-size: 100%; diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 6a1b5b5b49..fe73c2c66f 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -4826,7 +4826,7 @@ HTML while ($data = <$fd>) { chomp $data; last if ($data =~ s/^\t//); # contents of line - if ($data =~ /^(\S+) (.*)$/) { + if ($data =~ /^(\S+)(?: (.*))?$/) { $meta->{$1} = $2; } } @@ -4838,7 +4838,9 @@ HTML if ($group_size) { $current_color = ($current_color + 1) % $num_colors; } - print "\n"; + my $tr_class = $rev_color[$current_color]; + $tr_class .= ' boundary' if (exists $meta->{'boundary'}); + print "\n"; if ($group_size) { print "