Code

gitweb.cgi: git_blame2: Allow back-trekking through commits
authorLuben Tuikov <ltuikov@yahoo.com>
Sun, 23 Jul 2006 20:36:32 +0000 (13:36 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 25 Jul 2006 01:21:52 +0000 (18:21 -0700)
This patch adds the capability of back-trekking through
commits from git_blame2() as follows:
blame2->commit->blame2->commit->blame2->...->initial commit.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.cgi

index 57f4a2e263d24748fd447138d3d08100267c8805..2c2d9c8d8f8aa85ebc876edc481639ec5c75c803 100755 (executable)
@@ -2022,7 +2022,13 @@ sub git_commit {
                print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$hash")}, "commitdiff");
        }
        print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash")}, "tree") . "\n" .
-             "<br/><br/></div>\n";
+               "<br/>\n";
+       if (defined $file_name && defined $co{'parent'}) {
+               my $parent = $co{'parent'};
+               print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;hb=$parent;f=$file_name")}, "blame") . "\n";
+       }
+       print "<br/></div>\n";
+
        if (defined $co{'parent'}) {
                print "<div>\n" .
                      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$hash"), -class => "title"}, esc_html($co{'title'}) . $ref) . "\n" .