git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: blameview and file line number

From
Aneesh Kumar <aneesh.kumar@gmail.com>
Date
Jan 30, 2007, 09:12 UTC
Message-ID
<cc723f590701300112x6493a0eaw153aad1a18cd289a@mail.gmail.com>
In-Reply-To
<7vireo52xs.fsf@assigned-by-dhcp.cox.net>
On 1/30/07, Junio C Hamano <junkio@cox.net> wrote:
Show 9 quoted lines
> "Aneesh Kumar" <aneesh.kumar@gmail.com> 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));
 	}
 }
 
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 7 in “blameview and file line number”
  1. Aneesh KumarJan 30, 2007
  2. Junio C HamanoJan 30, 2007
  3. Aneesh KumarJan 30, 2007
  4. Junio C HamanoJan 30, 2007
  5. Shawn O. PearceJan 30, 2007
  6. Jeff KingJan 30, 2007
  7. Jeff KingJan 30, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.