Skip to content

Commit

Permalink
Revert "gitweb: extend blame to show links to diff and previous"
Browse files Browse the repository at this point in the history
This concept is very fine, but it makes blame slow
across renames and across branches, so revert it.
There is a better way to do this.

This reverts commit 03d06a8e26f4fbd37800d1e1125c6ecf4c104466.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Luben Tuikov authored and Junio C Hamano committed Sep 28, 2006
1 parent ab41dfb commit 709f898
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -2479,16 +2479,14 @@ sub git_blame2 {
print <<HTML;
<div class="page_body">
<table class="blame">
<tr><th>Prev</th><th>Diff</th><th>Commit</th><th>Line</th><th>Data</th></tr>
<tr><th>Commit</th><th>Line</th><th>Data</th></tr>
HTML
while (<$fd>) {
/^([0-9a-fA-F]{40}).*?(\d+)\)\s{1}(\s*.*)/;
my $full_rev = $1;
my $rev = substr($full_rev, 0, 8);
my $lineno = $2;
my $data = $3;
my %pco = parse_commit($full_rev);
my $parent = $pco{'parent'};

if (!defined $last_rev) {
$last_rev = $full_rev;
Expand All @@ -2497,25 +2495,11 @@ sub git_blame2 {
$current_color = ++$current_color % $num_colors;
}
print "<tr class=\"$rev_color[$current_color]\">\n";
# Print the Prev link
print "<td class=\"sha1\">";
print $cgi->a({-href => href(action=>"blame", hash_base=>$parent, file_name=>$file_name)},
esc_html(substr($parent, 0, 8)));
print "</td>\n";
# Print the Diff (blobdiff) link
print "<td>";
print $cgi->a({-href => href(action=>"blobdiff", file_name=>$file_name, hash_parent_base=>$parent,
hash_base=>$full_rev)},
esc_html("Diff"));
print "</td>\n";
# Print the Commit link
print "<td class=\"sha1\">" .
$cgi->a({-href => href(action=>"commit", hash=>$full_rev, file_name=>$file_name)},
esc_html($rev)) . "</td>\n";
# Print the Line number
print "<td class=\"linenr\"><a id=\"l$lineno\" href=\"#l$lineno\" class=\"linenr\">" .
esc_html($lineno) . "</a></td>\n";
# Print the Data
print "<td class=\"pre\">" . esc_html($data) . "</td>\n";
print "</tr>\n";
}
Expand Down

0 comments on commit 709f898

Please sign in to comment.