git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@gmail.com>
To: git@vger.kernel.org
Cc: git@vger.kernel.org
Subject: Re: git-gui blametool
Date: Mon, 12 Feb 2007 21:58:33 +0530	[thread overview]
Message-ID: <45D095B1.9070308@gmail.com> (raw)
In-Reply-To: <45D07A76.1070009@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 604 bytes --]

Aneesh Kumar K.V wrote:
> Hi All,
> 
> I found the git-gui blame tool interface quiet confusing with the all 
> those color code. What does the color code actually mean ? A simple 
> interface would be
> 
> [ commit ] [ line number ] [ code ]
> 
> ....
> ...
> --------------------------------------
> commit details of the selected commit
> 
> 

Sine i don't have a tcl/tk reference around i update blameview to show 
the above. The patch is attached below in case you are interested.

NOTE: How do i resize the widgets in perl-gtk ? I wanted the commit 
window to be a bit larger. Any help ?

-aneesh


[-- Attachment #2: blameview.perl.diff --]
[-- Type: text/x-patch, Size: 2180 bytes --]

diff --git a/contrib/blameview/blameview.perl b/contrib/blameview/blameview.perl
index 807d01f..67a0714 100755
--- a/contrib/blameview/blameview.perl
+++ b/contrib/blameview/blameview.perl
@@ -25,11 +25,13 @@ EOS
 
 my $window = Gtk2::Window->new('toplevel');
 $window->signal_connect(destroy => sub { Gtk2->main_quit });
+my $vbox = Gtk2::VBox->new();
+$vbox->set_homogeneous(0);
+$window->add($vbox);
 my $scrolled_window = Gtk2::ScrolledWindow->new;
-$window->add($scrolled_window);
+$vbox->pack_start($scrolled_window, 1, 1, 0);
 my $fileview = Gtk2::SimpleList->new(
     'Commit' => 'text',
-    'CommitInfo' => 'text',
     'FileLine' => 'text',
     'Data' => 'text'
 );
@@ -41,7 +43,26 @@ $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 $commitwindow = Gtk2::ScrolledWindow->new();
+$commitwindow->set_policy ('GTK_POLICY_AUTOMATIC','GTK_POLICY_AUTOMATIC');
+$vbox->pack_start($commitwindow, 1, 1, 0);
+my $commit_text = Gtk2::TextView->new();
+my $commit_buffer = Gtk2::TextBuffer->new();
+$commit_text->set_buffer($commit_buffer);
+$commitwindow->add($commit_text);
+
+$fileview->signal_connect (cursor_changed => sub {
+		my ($sl) = @_;
+		my ($path, $focus_column) = $sl->get_cursor();
+		my $row_ref = $sl->get_row_data_from_path ($path);
+		my $c_fh;
+		open($c_fh,  '-|', "git cat-file commit @$row_ref[0]")
+					or die "unable to find commit @$row_ref[0]";
+		my @buffer = <$c_fh>;
+		$commit_buffer->set_text("@buffer");
+		close($c_fh);
 		});
 
 my $fh;
@@ -50,7 +71,7 @@ open($fh, '-|', "git cat-file blob $hash:$fn")
 
 while(<$fh>) {
   chomp;
-  $fileview->{data}->[$.] = ['HEAD', '?', "$fn:$.", $_];
+  $fileview->{data}->[$.] = ['HEAD', "$fn:$.", $_];
 }
 
 my $blame;
@@ -79,8 +100,7 @@ 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 . ':' . ($s_lno+$i));
+		(substr($commit, 0, 8), $filename . ':' . ($s_lno+$i));
 	}
 }
 

  reply	other threads:[~2007-02-12 16:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-12 14:32 git-gui blametool Aneesh Kumar K.V
2007-02-12 16:28 ` Aneesh Kumar K.V [this message]
2007-02-12 17:54   ` Jeff King
2007-02-12 16:33 ` Aneesh Kumar K.V
2007-02-12 17:32 ` Shawn O. Pearce
2007-02-12 17:36   ` Aneesh Kumar
2007-02-12 19:20     ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45D095B1.9070308@gmail.com \
    --to=aneesh.kumar@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).