@matheusbsbs / matheus-bagliano / commits / 6de9433fd0
Fork 0

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>

Jakub Narebski committed Jul 25, 2009 at 00:44 UTC 6de9433fd0525632094f3cc172a606f217fa2097
2 files changed +8 -2
gitweb/gitweb.css
+4
@@ -242,6 +242,10 @@ tr.dark:hover {
242 background-color: #edece6;
243 }
244
245 +tr.boundary td.sha1 {
246 + font-weight: bold;
247 +}
248 +
249 td {
250 padding: 2px 5px;
251 font-size: 100%;
gitweb/gitweb.perl
+4 -2
@@ -4826,7 +4826,7 @@ HTML
4826 while ($data = <$fd>) {
4827 chomp $data;
4828 last if ($data =~ s/^\t//); # contents of line
4829 - if ($data =~ /^(\S+) (.*)$/) {
4829 + if ($data =~ /^(\S+)(?: (.*))?$/) {
4830 $meta->{$1} = $2;
4831 }
4832 }
@@ -4838,7 +4838,9 @@ HTML
4838 if ($group_size) {
4839 $current_color = ($current_color + 1) % $num_colors;
4840 }
4841 - print "<tr id=\"l$lineno\" class=\"$rev_color[$current_color]\">\n";
4841 + my $tr_class = $rev_color[$current_color];
4842 + $tr_class .= ' boundary' if (exists $meta->{'boundary'});
4843 + print "<tr id=\"l$lineno\" class=\"$tr_class\">\n";
4844 if ($group_size) {
4845 print "<td class=\"sha1\"";
4846 print " title=\"". esc_html($author) . ", $date\"";