From: Jakub Narebski Date: Fri, 24 Jul 2009 22:44:02 +0000 (+0200) Subject: gitweb: Mark boundary commits in 'blame' view X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/3c8296019ffc1b5e0bcdb3321a7b2dd1aaeab92f47219a948c71eae79be5d542 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 first cell in row, 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 slightly adjusted. With current gitweb API only root (parentless) commits can be boundary commits. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb.css b/gitweb.css index f692e74..1e87377 100644 --- a/gitweb.css +++ b/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.perl b/gitweb.perl index 6dcca8c..e0da960 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -4827,7 +4827,7 @@ HTML while ($data = <$fd>) { chomp $data; last if ($data =~ s/^\t//); # contents of line - if ($data =~ /^(\S+) (.*)$/) { + if ($data =~ /^(\S+)(?: (.*))?$/) { $meta->{$1} = $2; } } @@ -4839,7 +4839,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 "