threads / patch / 6580

patchblameview: Use git-cat-file to read the file content.

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

## tl;dr

4 messages between Jan 30, 2007 and Jan 30, 2007. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Aneesh Kumar K.V· Jan 30, 2007, 07:56 UTC · lore
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(-)
Show changes to contrib/blameview/blameview.perl +2 −1
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· Jan 30, 2007, 07:56 UTC · lore

[PATCH] blameview: Support browsable functionality to blameview.

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(-)
Show changes to contrib/blameview/blameview.perl +20 −3
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
Junio C Hamano· Jan 30, 2007, 10:33 UTC · re: Aneesh Kumar K.V · lore

Re: [PATCH] blameview: Support browsable functionality to blameview.

"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(-)
Show changes to git-send-email.perl +1 −1
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
Aneesh Kumar K.V· Jan 30, 2007, 07:56 UTC · lore

[PATCH] Update git-cat-file documentation

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(-)
Show changes to Documentation/git-cat-file.txt +3 −1
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

← back to recent threads