Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
blameview: Support browsable functionality to blameview.
author
Aneesh Kumar K.V
<aneesh.kumar@gmail.com>
Tue, 30 Jan 2007 07:56:50 +0000
(13:26 +0530)
committer
Junio C Hamano
<junkio@cox.net>
Mon, 5 Feb 2007 21:49:00 +0000
(13:49 -0800)
Double clicking on the row execs a new blameview with commit hash
as argument.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
contrib/blameview/blameview.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
0417941
)
diff --git
a/contrib/blameview/blameview.perl
b/contrib/blameview/blameview.perl
index 5e9a67c1235cd04cb51f2166b1dd2cf9fdada8eb..807d01fe3d6e7768f82c2b76e0203ed4b71f36fa 100755
(executable)
--- a/
contrib/blameview/blameview.perl
+++ b/
contrib/blameview/blameview.perl
@@
-3,7
+3,17
@@
use Gtk2 -init;
use Gtk2::SimpleList;
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"
Gtk2::Rc->parse_string(<<'EOS');
style "treeview_style"
@@
-27,17
+37,24
@@
$fileview->get_column(0)->set_spacing(0);
$fileview->set_size_request(1024, 768);
$fileview->set_rules_hint(1);
$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;
my $fh;
-open($fh, '-|', "git cat-file blob
HEAD
:$fn")
+open($fh, '-|', "git cat-file blob
$hash
:$fn")
or die "unable to open $fn: $!";
or die "unable to open $fn: $!";
+
while(<$fh>) {
chomp;
$fileview->{data}->[$.] = ['HEAD', '?', "$fn:$.", $_];
}
my $blame;
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);
or die "cannot start git-blame $fn";
Glib::IO->add_watch(fileno($blame), 'in', \&read_blame_line);