summaryrefslogtreecommitdiff
path: root/gitweb/gitweb.perl
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2009-07-24 22:44:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-07-25 08:39:16 (GMT)
commit3665e7e7f2b210f6896815d563255c364a861a6e (patch)
tree1cdc586ec69e63af250f6a2b4f2f361183bf7f92 /gitweb/gitweb.perl
parent11930423d11c1256014e10b940c4ee8f12328739 (diff)
downloadgit-3665e7e7f2b210f6896815d563255c364a861a6e.zip
git-3665e7e7f2b210f6896815d563255c364a861a6e.tar.gz
git-3665e7e7f2b210f6896815d563255c364a861a6e.tar.bz2
gitweb: Mark commits with no "previous" in 'blame' view
Use "no-previous" class to mark blamed commits which do not have "previous" header. Those are commits in which blamed file was created (added); this includes boundary commits. This means that 'linenr' link leads to blamed commit, not (one of) parent of blamed commit. Therefore currently line number for such commit uses bold weight font to denote this situation; the effect is subtle. Use "multiple-previous" class in the opposite situation, where blamed commit has multiple "previous" headers (is an evil merge). Currently this class is not used for styling. In this situation 'linenr' link leads to first of "previous" commits (first parent). 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.perl7
1 files changed, 6 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b8a121b..128bddd 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4819,7 +4819,7 @@ HTML
my ($full_rev, $orig_lineno, $lineno, $group_size) =
($line =~ /^([0-9a-f]{40}) (\d+) (\d+)(?: (\d+))?$/);
if (!exists $metainfo{$full_rev}) {
- $metainfo{$full_rev} = {};
+ $metainfo{$full_rev} = { 'nprevious' => 0 };
}
my $meta = $metainfo{$full_rev};
my $data;
@@ -4829,6 +4829,9 @@ HTML
if ($data =~ /^(\S+)(?: (.*))?$/) {
$meta->{$1} = $2 unless exists $meta->{$1};
}
+ if ($data =~ /^previous /) {
+ $meta->{'nprevious'}++;
+ }
}
my $short_rev = substr($full_rev, 0, 8);
my $author = $meta->{'author'};
@@ -4840,6 +4843,8 @@ HTML
}
my $tr_class = $rev_color[$current_color];
$tr_class .= ' boundary' if (exists $meta->{'boundary'});
+ $tr_class .= ' no-previous' if ($meta->{'nprevious'} == 0);
+ $tr_class .= ' multiple-previous' if ($meta->{'nprevious'} > 1);
print "<tr id=\"l$lineno\" class=\"$tr_class\">\n";
if ($group_size) {
print "<td class=\"sha1\"";