git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blameview: Use git-cat-file to read the file content.
       [not found] <11701438112263-git-send-email->
@ 2007-01-30  7:56 ` Aneesh Kumar K.V
       [not found] ` <11701438241247-git-send-email->
  1 sibling, 0 replies; 4+ messages in thread
From: Aneesh Kumar K.V @ 2007-01-30  7:56 UTC (permalink / raw)
  To: git; +Cc: junkio

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] blameview: Support browsable functionality to blameview.
       [not found] ` <11701438241247-git-send-email->
@ 2007-01-30  7:56   ` Aneesh Kumar K.V
  2007-01-30 10:33     ` Junio C Hamano
       [not found]   ` <11701438362085-git-send-email->
  1 sibling, 1 reply; 4+ messages in thread
From: Aneesh Kumar K.V @ 2007-01-30  7:56 UTC (permalink / raw)
  To: git; +Cc: junkio

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] Update git-cat-file documentation
       [not found]   ` <11701438362085-git-send-email->
@ 2007-01-30  7:56     ` Aneesh Kumar K.V
  0 siblings, 0 replies; 4+ messages in thread
From: Aneesh Kumar K.V @ 2007-01-30  7:56 UTC (permalink / raw)
  To: git; +Cc: junkio

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] blameview: Support browsable functionality to blameview.
  2007-01-30  7:56   ` [PATCH] blameview: Support browsable functionality to blameview Aneesh Kumar K.V
@ 2007-01-30 10:33     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2007-01-30 10:33 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: git

"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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-30 10:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <11701438112263-git-send-email->
2007-01-30  7:56 ` [PATCH] blameview: Use git-cat-file to read the file content Aneesh Kumar K.V
     [not found] ` <11701438241247-git-send-email->
2007-01-30  7:56   ` [PATCH] blameview: Support browsable functionality to blameview Aneesh Kumar K.V
2007-01-30 10:33     ` Junio C Hamano
     [not found]   ` <11701438362085-git-send-email->
2007-01-30  7:56     ` [PATCH] Update git-cat-file documentation Aneesh Kumar K.V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).