Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitk: Add keybinding to switch to parent commit
author
Max Kirillov
<max@max630.net>
Tue, 8 Jul 2014 20:45:35 +0000
(23:45 +0300)
committer
Paul Mackerras
<paulus@samba.org>
Fri, 8 Aug 2014 06:39:02 +0000
(16:39 +1000)
Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
bde4a0f
)
diff --git
a/gitk
b/gitk
index c8df35dee58aed6ba652ee9ab998f405539991eb..3520bdaebc29fd6c93724b0a46484ee5e9403831 100755
(executable)
--- a/
gitk
+++ b/
gitk
@@
-2594,6
+2594,9
@@
proc makewindow {} {
bind $ctext $ctxbut {pop_diff_menu %W %X %Y %x %y}
bind $ctext <Button-1> {focus %W}
bind $ctext <<Selection>> rehighlight_search_results
bind $ctext $ctxbut {pop_diff_menu %W %X %Y %x %y}
bind $ctext <Button-1> {focus %W}
bind $ctext <<Selection>> rehighlight_search_results
+ for {set i 1} {$i < 10} {incr i} {
+ bind . <$M1B-Key-$i> [list go_to_parent $i]
+ }
set maincursor [. cget -cursor]
set textcursor [$ctext cget -cursor]
set maincursor [. cget -cursor]
set textcursor [$ctext cget -cursor]
@@
-3017,6
+3020,7
@@
proc keys {} {
[mc "<Down>, n, j Move down one commit"]
[mc "<Left>, z, h Go back in history list"]
[mc "<Right>, x, l Go forward in history list"]
[mc "<Down>, n, j Move down one commit"]
[mc "<Left>, z, h Go back in history list"]
[mc "<Right>, x, l Go forward in history list"]
+[mc "<%s-n> Go to n-th parent of current commit in history list" $M1T]
[mc "<PageUp> Move up one page in commit list"]
[mc "<PageDown> Move down one page in commit list"]
[mc "<%s-Home> Scroll to top of commit list" $M1T]
[mc "<PageUp> Move up one page in commit list"]
[mc "<PageDown> Move down one page in commit list"]
[mc "<%s-Home> Scroll to top of commit list" $M1T]
@@
-7497,6
+7501,14
@@
proc goforw {} {
}
}
}
}
+proc go_to_parent {i} {
+ global parents curview targetid
+ set ps $parents($curview,$targetid)
+ if {[llength $ps] >= $i} {
+ selbyid [lindex $ps [expr $i - 1]]
+ }
+}
+
proc gettree {id} {
global treefilelist treeidlist diffids diffmergeid treepending
global nullid nullid2
proc gettree {id} {
global treefilelist treeidlist diffids diffmergeid treepending
global nullid nullid2