]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Mark boundary commits in 'blame' view
authorJakub Narebski <redacted>
Fri, 24 Jul 2009 22:44:02 +0000 (00:44 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:39 +0000 (00:50 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.css
gitweb.perl

index f692e74a68685a5724aadca9cc19153c216b37e908616a2e0a59edde2ed86a24..1e8737752943865433ca03918206e10cd653d2175bd21932fe4b2b29aa7340cd 100644 (file)
@@ -242,6 +242,10 @@ tr.dark:hover {
        background-color: #edece6;
 }
 
+tr.boundary td.sha1 {
+       font-weight: bold;
+}
+
 td {
        padding: 2px 5px;
        font-size: 100%;
index 6dcca8c527c9998bfbdaef2a1f2e34124922893b62218679d0d2512106a019b5..e0da96000b8d999339f677b3256b652a4a9644455c4cafa79ec492faaa31446d 100755 (executable)
@@ -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 "<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\"";
This page took 0.280643 seconds and 4 git commands to generate.