{"thread":{"id":"6796","subject":"Fwd: [PATCH] blameview: Move the commit info to a pane below the blame window.","startedAt":"2007-02-13T11:50:34Z","lastAt":"2007-02-13T17:47:02Z","messageCount":2,"participants":["Aneesh Kumar","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"34398","messageId":"cc723f590702130350x5dab5188y13a6041b5c4bd574@mail.gmail.com","threadId":"6796","inReplyTo":"11713014281257-git-send-email-aneesh.kumar@gmail.com","subject":"Fwd: [PATCH] blameview: Move the commit info to a pane below the blame window.","fromName":"Aneesh Kumar","fromEmail":"aneesh.kumar@gmail.com","sentAt":"2007-02-13T11:50:34Z","receivedAt":"2007-02-13T11:50:34Z","isPatch":true,"sender":{"key":"aneesh.kumar@gmail.com","avatar":"https://gravatar.com/avatar/0621fc0b2f14ead1e9024382f16053a808c148596da30c1b92572fa075621f68?d=mp&s=160"},"body":"Forwarding this again. Mail sent by git send-email doesn't appear in\ngit mailing list archive. I don't know why. I don't get any bounce\nmails also.\n\n-aneesh\n\n---------- Forwarded message ----------\nFrom: Aneesh Kumar K.V <aneesh.kumar@gmail.com>\nDate: Feb 12, 2007 11:00 PM\nSubject: [PATCH] blameview: Move the commit info to a pane below the\nblame window.\nTo: git@vger.kernel.org\nCc: junkio@cox.net, \"Aneesh Kumar K. V\" <aneesh.kumar@gmail.com>\n\n\nAlso spawn the the new blameview in the background\n\nSigned-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>\n---\n contrib/blameview/blameview.perl |   33 ++++++++++++++++++++++++++-------\n 1 files changed, 26 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/blameview/blameview.perl b/contrib/blameview/blameview.perl\nindex 807d01f..a9a509f 100755\n--- a/contrib/blameview/blameview.perl\n+++ b/contrib/blameview/blameview.perl\n@@ -25,11 +25,12 @@ EOS\n\n my $window = Gtk2::Window->new('toplevel');\n $window->signal_connect(destroy => sub { Gtk2->main_quit });\n+my $vpan = Gtk2::VPaned->new();\n+$window->add($vpan);\n my $scrolled_window = Gtk2::ScrolledWindow->new;\n-$window->add($scrolled_window);\n+$vpan->pack1($scrolled_window, 1, 1);\n my $fileview = Gtk2::SimpleList->new(\n     'Commit' => 'text',\n-    'CommitInfo' => 'text',\n     'FileLine' => 'text',\n     'Data' => 'text'\n );\n@@ -40,8 +41,27 @@ $fileview->set_rules_hint(1);\n $fileview->signal_connect (row_activated => sub {\n                my ($sl, $path, $column) = @_;\n                my $row_ref = $sl->get_row_data_from_path ($path);\n-               system(\"blameview @$row_ref[0] $fn\");\n-               # $row_ref is now an array ref to the double-clicked row's data.\n+               system(\"blameview @$row_ref[0] $fn &\");\n+               });\n+\n+my $commitwindow = Gtk2::ScrolledWindow->new();\n+$commitwindow->set_policy ('GTK_POLICY_AUTOMATIC','GTK_POLICY_AUTOMATIC');\n+$vpan->pack2($commitwindow, 1, 1);\n+my $commit_text = Gtk2::TextView->new();\n+my $commit_buffer = Gtk2::TextBuffer->new();\n+$commit_text->set_buffer($commit_buffer);\n+$commitwindow->add($commit_text);\n+\n+$fileview->signal_connect (cursor_changed => sub {\n+               my ($sl) = @_;\n+               my ($path, $focus_column) = $sl->get_cursor();\n+               my $row_ref = $sl->get_row_data_from_path ($path);\n+               my $c_fh;\n+               open($c_fh,  '-|', \"git cat-file commit @$row_ref[0]\")\n+                                       or die \"unable to find commit\n@$row_ref[0]\";\n+               my @buffer = <$c_fh>;\n+               $commit_buffer->set_text(\"@buffer\");\n+               close($c_fh);\n                });\n\n my $fh;\n@@ -50,7 +70,7 @@ open($fh, '-|', \"git cat-file blob $hash:$fn\")\n\n while(<$fh>) {\n   chomp;\n-  $fileview->{data}->[$.] = ['HEAD', '?', \"$fn:$.\", $_];\n+  $fileview->{data}->[$.] = ['HEAD', \"$fn:$.\", $_];\n }\n\n my $blame;\n@@ -79,8 +99,7 @@ sub flush_blame_line {\n\n        for(my $i = 0; $i < $cnt; $i++) {\n                @{$fileview->{data}->[$lno+$i-1]}[0,1,2] =\n-                   (substr($commit, 0, 8), $info,\n-                    $filename . ':' . ($s_lno+$i));\n+               (substr($commit, 0, 8), $filename . ':' . ($s_lno+$i));\n        }\n }\n\n--\n1.5.0.rc4.345.gb4d2-dirty\n"},{"id":"34436","messageId":"7vlkj2x84p.fsf@assigned-by-dhcp.cox.net","threadId":"6796","inReplyTo":"cc723f590702130350x5dab5188y13a6041b5c4bd574@mail.gmail.com","subject":"Re: Fwd: [PATCH] blameview: Move the commit info to a pane below the blame window.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-13T17:47:02Z","receivedAt":"2007-02-13T17:47:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.  I think I've already applied this and pushed it out\nlast night.\n"}]}