All of lore.kernel.org
 help / color / mirror / Atom feed
* git-gui blametool
@ 2007-02-12 14:32 Aneesh Kumar K.V
  2007-02-12 16:28 ` Aneesh Kumar K.V
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Aneesh Kumar K.V @ 2007-02-12 14:32 UTC (permalink / raw)
  To: git

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


-aneesh

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

* Re: git-gui blametool
  2007-02-12 14:32 git-gui blametool Aneesh Kumar K.V
@ 2007-02-12 16:28 ` Aneesh Kumar K.V
  2007-02-12 17:54   ` Jeff King
  2007-02-12 16:33 ` Aneesh Kumar K.V
  2007-02-12 17:32 ` Shawn O. Pearce
  2 siblings, 1 reply; 7+ messages in thread
From: Aneesh Kumar K.V @ 2007-02-12 16:28 UTC (permalink / raw)
  To: git; +Cc: git

[-- 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));
 	}
 }
 

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

* Re: git-gui blametool
  2007-02-12 14:32 git-gui blametool Aneesh Kumar K.V
  2007-02-12 16:28 ` Aneesh Kumar K.V
@ 2007-02-12 16:33 ` Aneesh Kumar K.V
  2007-02-12 17:32 ` Shawn O. Pearce
  2 siblings, 0 replies; 7+ messages in thread
From: Aneesh Kumar K.V @ 2007-02-12 16:33 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: git

[-- 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));
 	}
 }
 

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

* Re: git-gui blametool
  2007-02-12 14:32 git-gui blametool Aneesh Kumar K.V
  2007-02-12 16:28 ` Aneesh Kumar K.V
  2007-02-12 16:33 ` Aneesh Kumar K.V
@ 2007-02-12 17:32 ` Shawn O. Pearce
  2007-02-12 17:36   ` Aneesh Kumar
  2 siblings, 1 reply; 7+ messages in thread
From: Shawn O. Pearce @ 2007-02-12 17:32 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: git

"Aneesh Kumar K.V" <aneesh.kumar@gmail.com> wrote:
> I found the git-gui blame tool interface quiet confusing with the all 
> those color code. What does the color code actually mean ?

Can you try the version of git-gui that Junio pushed out to `master`
last night?

> A simple 
> interface would be
> 
> [ commit ] [ line number ] [ code ]
> 
> ....
> ...
> --------------------------------------
> commit details of the selected commit

Because it uses this interface.  Almost.  It doesn't show the
[commit] column.

-- 
Shawn.

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

* Re: git-gui blametool
  2007-02-12 17:32 ` Shawn O. Pearce
@ 2007-02-12 17:36   ` Aneesh Kumar
  2007-02-12 19:20     ` Shawn O. Pearce
  0 siblings, 1 reply; 7+ messages in thread
From: Aneesh Kumar @ 2007-02-12 17:36 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git

On 2/12/07, Shawn O. Pearce <spearce@spearce.org> wrote:
> "Aneesh Kumar K.V" <aneesh.kumar@gmail.com> wrote:
> > I found the git-gui blame tool interface quiet confusing with the all
> > those color code. What does the color code actually mean ?
>
> Can you try the version of git-gui that Junio pushed out to `master`
> last night?
>
> > A simple
> > interface would be
> >
> > [ commit ] [ line number ] [ code ]
> >
> > ....
> > ...
> > --------------------------------------
> > commit details of the selected commit
>
> Because it uses this interface.  Almost.  It doesn't show the
> [commit] column.
>

I tried the same one. I was requesting to add the commit column. Right
now the interface is pretty confusing. After some reading of the code
i figured out that colours have a specific meaning. May be we need to
add a manual to the same.

but any how having commit in a column like this is really nice. I just
sent a new patch for blameview. That should give an idea how much the
interface looks better.

-aneesh

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

* Re: git-gui blametool
  2007-02-12 16:28 ` Aneesh Kumar K.V
@ 2007-02-12 17:54   ` Jeff King
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff King @ 2007-02-12 17:54 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: git

On Mon, Feb 12, 2007 at 09:58:33PM +0530, Aneesh Kumar K.V wrote:

> 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.

It certainly looks better, though the whole thing is still horribly
ugly. You might play with replacing the main List widget with something
a bit more compact.

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

Something like this?

-Peff

diff --git a/contrib/blameview/blameview.perl b/contrib/blameview/blameview.perl
index 67a0714..fd174eb 100755
--- a/contrib/blameview/blameview.perl
+++ b/contrib/blameview/blameview.perl
@@ -51,6 +51,7 @@ $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);
+$commit_text->set_size_request(1024, 200);
 $commitwindow->add($commit_text);
 
 $fileview->signal_connect (cursor_changed => sub {

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

* Re: git-gui blametool
  2007-02-12 17:36   ` Aneesh Kumar
@ 2007-02-12 19:20     ` Shawn O. Pearce
  0 siblings, 0 replies; 7+ messages in thread
From: Shawn O. Pearce @ 2007-02-12 19:20 UTC (permalink / raw)
  To: Aneesh Kumar; +Cc: git

Aneesh Kumar <aneesh.kumar@gmail.com> wrote:
> I tried the same one. I was requesting to add the commit column. Right
> now the interface is pretty confusing. After some reading of the code
> i figured out that colours have a specific meaning. May be we need to
> add a manual to the same.
> 
> but any how having commit in a column like this is really nice. I just
> sent a new patch for blameview. That should give an idea how much the
> interface looks better.

Ahhh.  I was thinking of adding it myself anyway.  Now that two
people think showing a commit column might be a good idea, I'll
add it in.

-- 
Shawn.

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

end of thread, other threads:[~2007-02-12 19:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-12 14:32 git-gui blametool Aneesh Kumar K.V
2007-02-12 16:28 ` Aneesh Kumar K.V
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.