summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 39816d6)
raw | patch | inline | side by side (parent: 39816d6)
author | Alexander Gavrilov <angavrilov@gmail.com> | |
Sat, 23 Aug 2008 08:29:08 +0000 (12:29 +0400) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Tue, 26 Aug 2008 10:10:10 +0000 (20:10 +1000) |
This adds a new item to the file list popup menu, that calls git gui
blame for the selected file, starting with the first parent of the
current commit.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
blame for the selected file, starting with the first parent of the
current commit.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index 7698b7081706026f5e036ebdcbfe9ca8c9fc4506..2eaa2ae7d6f692f6063ebbd211eaab30212c2eae 100755 (executable)
--- a/gitk
+++ b/gitk
-command {flist_hl 1}
$flist_menu add command -label [mc "External diff"] \
-command {external_diff}
+ $flist_menu add command -label [mc "Blame parent commit"] \
+ -command {external_blame 1}
}
# Windows sends all mouse wheel events to the current focused window, not
}
}
+proc external_blame {parent_idx} {
+ global flist_menu_file
+ global nullid nullid2
+ global parentlist selectedline currentid
+
+ if {$parent_idx > 0} {
+ set base_commit [lindex $parentlist $selectedline [expr {$parent_idx-1}]]
+ } else {
+ set base_commit $currentid
+ }
+
+ if {$base_commit eq {} || $base_commit eq $nullid || $base_commit eq $nullid2} {
+ error_popup [mc "No such commit"]
+ return
+ }
+
+ if {[catch {exec git gui blame $base_commit $flist_menu_file &} err]} {
+ error_popup [mc "git gui blame: command failed: $err"]
+ }
+}
+
# delete $dir when we see eof on $f (presumably because the child has exited)
proc delete_at_eof {f dir} {
while {[gets $f line] >= 0} {}