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

4 messages from 2007-01-30 to 2007-01-30. Participants: Aneesh Kumar K.V, Junio C Hamano.
Thread: https://gitlist.dev/t/6580

## Aneesh Kumar K.V, 2007-01-30 07:56

Subject: [PATCH] blameview: Use git-cat-file to read the file content.
Message-ID: <45befa5a.3eba48a4.1e16.ffffabd9@mx.google.com>
URL: https://gitlist.dev/e/45befa5a.3eba48a4.1e16.ffffabd9%40mx.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

```

## Aneesh Kumar K.V, 2007-01-30 07:56

Subject: [PATCH] blameview: Support browsable functionality to blameview.
Message-ID: <45befa66.29cc817d.6c37.ffffa9bc@mx.google.com>
URL: https://gitlist.dev/e/45befa66.29cc817d.6c37.ffffa9bc%40mx.google.com
In-Reply-To: <11701438241247-git-send-email->

```
From: Aneesh Kumar K.V <aneesh.kumar@gmail.com> - unquoted

Double clicking on the row  exec a new blameview with commit hash
as argument.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
---
 contrib/blameview/blameview.perl |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/contrib/blameview/blameview.perl b/contrib/blameview/blameview.perl
index 8261e47..8ad9bcf 100755
--- a/contrib/blameview/blameview.perl
+++ b/contrib/blameview/blameview.perl
@@ -3,7 +3,17 @@
 use Gtk2 -init;
 use Gtk2::SimpleList;
 
-my $fn = shift or die "require filename to blame";
+my $hash;
+my $fn;
+if ( @ARGV == 1 ) {
+	$hash = "HEAD";
+	$fn = shift;
+} elsif ( @ARGV == 2 ) {
+	$hash = shift;
+	$fn = shift;
+} else {
+	die "Usage blameview [<rev>] <filename>";
+}
 
 Gtk2::Rc->parse_string(<<'EOS');
 style "treeview_style"
@@ -27,17 +37,24 @@ $scrolled_window->add($fileview);
 $fileview->get_column(0)->set_spacing(0);
 $fileview->set_size_request(1024, 768);
 $fileview->set_rules_hint(1);
+$fileview->signal_connect (row_activated => sub {
+		my ($sl, $path, $column) = @_;
+		my $row_ref = $sl->get_row_data_from_path ($path);
+		system("blameview @$row_ref[0] $fn");
+		# $row_ref is now an array ref to the double-clicked row's data.
+		});
 
 my $fh;
-open($fh, '-|', "git cat-file blob HEAD:$fn")
+open($fh, '-|', "git cat-file blob $hash:$fn")
   or die "unable to open $fn: $!";
+
 while(<$fh>) {
   chomp;
   $fileview->{data}->[$.] = ['HEAD', '?', "$fn:$.", $_];
 }
 
 my $blame;
-open($blame, '-|', qw(git blame --incremental --), $fn)
+open($blame, '-|', qw(git blame --incremental --), $fn, $hash)
     or die "cannot start git-blame $fn";
 
 Glib::IO->add_watch(fileno($blame), 'in', \&read_blame_line);
-- 
1.5.0.rc2.75.gdbaa0-dirty

```

## Aneesh Kumar K.V, 2007-01-30 07:56

Subject: [PATCH] Update git-cat-file documentation
Message-ID: <45befa72.48e904b7.4b64.ffffd83b@mx.google.com>
URL: https://gitlist.dev/e/45befa72.48e904b7.4b64.ffffd83b%40mx.google.com
In-Reply-To: <11701438362085-git-send-email->

```
From: Aneesh Kumar K.V <aneesh.kumar@gmail.com> - unquoted

Update git-cat-file documentation with references for different
ways of specifying <objects>

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
---
 Documentation/git-cat-file.txt |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt
index 7e90ce9..075c0d0 100644
--- a/Documentation/git-cat-file.txt
+++ b/Documentation/git-cat-file.txt
@@ -19,7 +19,9 @@ or '-s' is used to find the object size.
 OPTIONS
 -------
 <object>::
-	The sha1 identifier of the object.
+	The name of the object to show.
+	For a more complete list of ways to spell object names, see
+	"SPECIFYING REVISIONS" section in gitlink:git-rev-parse[1].
 
 -t::
 	Instead of the content, show the object type identified by
-- 
1.5.0.rc2.75.gdbaa0-dirty

```

## Junio C Hamano, 2007-01-30 10:33

Subject: Re: [PATCH] blameview: Support browsable functionality to blameview.
Message-ID: <7vfy9s248b.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vfy9s248b.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <45befa66.29cc817d.6c37.ffffa9bc@mx.google.com>

```
"Aneesh Kumar K.V" <aneesh.kumar@gmail.com> writes:

> From: Aneesh Kumar K.V <aneesh.kumar@gmail.com> - unquoted

Sorry, my fault.

-- >8 --
[PATCH] git-send-email: remove debugging output.

rfc2047 unquoter spitted out an annoying "- unquoted" which was
added during debugging but I forgot to remove.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-send-email.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 8dc2ee0..6a285bf 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -408,7 +408,7 @@ sub unquote_rfc2047 {
 		s/_/ /g;
 		s/=([0-9A-F]{2})/chr(hex($1))/eg;
 	}
-	return "$_ - unquoted";
+	return "$_";
 }
 
 sub send_message
-- 
1.5.0.rc2.77.g1732a

```
