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

[PATCH] blameview: Use git-cat-file to read the file content.

From
Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Date
Jan 30, 2007, 07:56 UTC
Message-ID
<45befa5a.3eba48a4.1e16.ffffabd9@mx.google.com>
In-Reply-To
<11701438112263-git-send-email->
From: Aneesh Kumar K.V <aneesh.kumar@gmail.com> - unquoted

Fix blameview to use git-cat-file to read the file content. This make sure we show the right content when we have modified file in the working directory which is not committed.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
---
 contrib/blameview/blameview.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/contrib/blameview/blameview.perl b/contrib/blameview/blameview.perl
index e8bcb1b..8261e47 100755
--- a/contrib/blameview/blameview.perl
+++ b/contrib/blameview/blameview.perl
@@ -28,7 +28,8 @@ $fileview->get_column(0)->set_spacing(0);
 $fileview->set_size_request(1024, 768);
 $fileview->set_rules_hint(1);
 
-open(my $fh, '<', $fn)
+my $fh;
+open($fh, '-|', "git cat-file blob HEAD:$fn")
   or die "unable to open $fn: $!";
 while(<$fh>) {
   chomp;
-- 
1.5.0.rc2.75.gdbaa0-dirty
Next: Aneesh Kumar K.V
Message 1 of 4 in “blameview: Use git-cat-file to read the file content.”
  1. blameview: Use git-cat-file to read the file content.Aneesh Kumar K.V, Jan 30, 2007
  2. blameview: Support browsable functionality to blameview.Aneesh Kumar K.V, Jan 30, 2007
  3. Junio C HamanoJan 30, 2007
  4. Update git-cat-file documentationAneesh Kumar K.V, Jan 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.