Skip to content

Commit

Permalink
gitweb: Mark boundary commits in 'blame' view
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Jul 25, 2009
1 parent 0a49a79 commit 6de9433
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions gitweb/gitweb.css
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ tr.dark:hover {
background-color: #edece6;
}

tr.boundary td.sha1 {
font-weight: bold;
}

td {
padding: 2px 5px;
font-size: 100%;
Expand Down
6 changes: 4 additions & 2 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -4826,7 +4826,7 @@ sub git_blame {
while ($data = <$fd>) {
chomp $data;
last if ($data =~ s/^\t//); # contents of line
if ($data =~ /^(\S+) (.*)$/) {
if ($data =~ /^(\S+)(?: (.*))?$/) {
$meta->{$1} = $2;
}
}
Expand All @@ -4838,7 +4838,9 @@ sub git_blame {
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\"";
Expand Down

0 comments on commit 6de9433

Please sign in to comment.