提交 6de9433f 编写于 作者: J Jakub Narebski 提交者: Junio C Hamano

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: NJakub Narebski <jnareb@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 0a49a799
......@@ -242,6 +242,10 @@ tr.dark:hover {
background-color: #edece6;
}
tr.boundary td.sha1 {
font-weight: bold;
}
td {
padding: 2px 5px;
font-size: 100%;
......
......@@ -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;
}
}
......@@ -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\"";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册