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

index 1e8737752943865433ca03918206e10cd653d2175bd21932fe4b2b29aa7340cd..10868fadd45112702267cb6fd92ee935458b997e6b26e48e7331dae09b2f3637 100644 (file)
@@ -242,7 +242,8 @@ tr.dark:hover {
        background-color: #edece6;
 }
 
        background-color: #edece6;
 }
 
-tr.boundary td.sha1 {
+tr.boundary td.sha1,
+tr.no-previous td.linenr {
        font-weight: bold;
 }
 
        font-weight: bold;
 }
 
index 13910bc9fa4668106f5e43882f0b1d9537f883f627edebbf6fee21fa974f571a..bf75e53f21c870017817838706a7e63079c3cd44298400f4e6cfe6053a966bd8 100755 (executable)
@@ -4820,7 +4820,7 @@ HTML
                my ($full_rev, $orig_lineno, $lineno, $group_size) =
                   ($line =~ /^([0-9a-f]{40}) (\d+) (\d+)(?: (\d+))?$/);
                if (!exists $metainfo{$full_rev}) {
                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;
                }
                my $meta = $metainfo{$full_rev};
                my $data;
@@ -4830,6 +4830,9 @@ HTML
                        if ($data =~ /^(\S+)(?: (.*))?$/) {
                                $meta->{$1} = $2 unless exists $meta->{$1};
                        }
                        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'};
                }
                my $short_rev = substr($full_rev, 0, 8);
                my $author = $meta->{'author'};
@@ -4841,6 +4844,8 @@ HTML
                }
                my $tr_class = $rev_color[$current_color];
                $tr_class .= ' boundary' if (exists $meta->{'boundary'});
                }
                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\"";
                print "<tr id=\"l$lineno\" class=\"$tr_class\">\n";
                if ($group_size) {
                        print "<td class=\"sha1\"";
This page took 0.2301 seconds and 4 git commands to generate.