@matheusbsbs / matheus-bagliano / commits / 46308ea1da
Fork 0

gitk: Select something appropriate on cherry-pick, branch reset and checkout

This makes gitk select the new commit when cherry-picking, and select the new checked-out head when resetting or checking out a branch. This feels more natural because the user is usually more interested in that commit now than whatever was selected before. Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras committed Jan 15, 2008 at 22:16 UTC 46308ea1da6794bef1a99b0b1c892c46dec40146
1 file changed +4 -1
gitk
+4 -1
@@ -3397,7 +3397,7 @@ proc ordertoken {id} {
3397 set id [first_real_child $curview,$p]
3398 if {$id eq {}} {
3399 # it's a root
3400 - set tok [lindex $varctok($curview) $a]
3400 + set tok [lindex $varctok($curview) $varcid($curview,$p)]
3401 break
3402 }
3403 if {[llength $parents($curview,$id)] == 1} {
@@ -7028,6 +7028,7 @@ proc cherrypick {} {
7028 }
7029 redrawtags $oldhead
7030 redrawtags $newhead
7031 + selbyid $newhead
7032 }
7033 notbusy cherrypick
7034 }
@@ -7072,6 +7073,7 @@ proc resethead {} {
7073 dohidelocalchanges
7074 filerun $fd [list readresetstat $fd]
7075 nowbusy reset [mc "Resetting"]
7076 + selbyid $rowmenuid
7077 }
7078 }
7079
@@ -7144,6 +7146,7 @@ proc cobranch {} {
7146 redrawtags $headids($oldmainhead)
7147 }
7148 redrawtags $headmenuid
7149 + selbyid $headmenuid
7150 }
7151 if {$showlocalchanges} {
7152 dodiffindex