Re: blameview and file line number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/30/07, Junio C Hamano <junkio@xxxxxxx> wrote:
"Aneesh Kumar" <aneesh.kumar@xxxxxxxxx> writes:

> Is it a typo or intentional ? I found the blameview output confusing.

Compare it with gitweb or textual output (blame -n -f).

It is supposed to show the line number in the original file.
Using lno is obviously wrong, as we are not reinventing "cat -n"
here ;-).

In that case the heading is wrong. It should be something other than
Filenum. How about the patch below. On top of the series i sent you
before.

-aneesh
diff --git a/contrib/blameview/blameview.perl b/contrib/blameview/blameview.perl
index 8ad9bcf..9149e35 100755
--- a/contrib/blameview/blameview.perl
+++ b/contrib/blameview/blameview.perl
@@ -29,6 +29,7 @@ my $scrolled_window = Gtk2::ScrolledWindow->new;
 $window->add($scrolled_window);
 my $fileview = Gtk2::SimpleList->new(
     'Commit' => 'text',
+    'OrigLine' => 'text',
     'CommitInfo' => 'text',
     'FileLine' => 'text',
     'Data' => 'text'
@@ -50,7 +51,7 @@ open($fh, '-|', "git cat-file blob $hash:$fn")
 
 while(<$fh>) {
   chomp;
-  $fileview->{data}->[$.] = ['HEAD', '?', "$fn:$.", $_];
+  $fileview->{data}->[$.] = ['HEAD','?', '?', "$.", $_];
 }
 
 my $blame;
@@ -79,8 +80,8 @@ sub flush_blame_line {
 
 	for(my $i = 0; $i < $cnt; $i++) {
 		@{$fileview->{data}->[$lno+$i-1]}[0,1,2] =
-		    (substr($commit, 0, 8), $info,
-		     $filename . ':' . ($lno+$i));
+		    (substr($commit, 0, 8), 
+		     $filename . ':' . ($s_lno+$i), $info, ($lno+$i));
 	}
 }
 

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]