summaryrefslogtreecommitdiff
path: root/gitweb/gitweb.perl
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2009-07-24 22:44:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-07-25 08:39:16 (GMT)
commit6de9433fd0525632094f3cc172a606f217fa2097 (patch)
treed7c2c71f27945775d430073f8fcc885f3b35c45d /gitweb/gitweb.perl
parent0a49a7997b7380c1552786adb544d50d005368f8 (diff)
downloadgit-6de9433fd0525632094f3cc172a606f217fa2097.zip
git-6de9433fd0525632094f3cc172a606f217fa2097.tar.gz
git-6de9433fd0525632094f3cc172a606f217fa2097.tar.bz2
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 <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.perl')
-rwxr-xr-xgitweb/gitweb.perl6
1 files changed, 4 insertions, 2 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 7fbd5ff..3078b92 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 "<tr id=\"l$lineno\" class=\"$rev_color[$current_color]\">\n";
+ my $tr_class = $rev_color[$current_color];
+ $tr_class .= ' boundary' if (exists $meta->{'boundary'});
+ print "<tr id=\"l$lineno\" class=\"$tr_class\">\n";
if ($group_size) {
print "<td class=\"sha1\"";
print " title=\"". esc_html($author) . ", $date\"";