Skip to content

Commit 46308ea

Browse files
committed
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>
1 parent 3e76608 commit 46308ea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gitk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3397,7 +3397,7 @@ proc ordertoken {id} {
33973397
set id [first_real_child $curview,$p]
33983398
if {$id eq {}} {
33993399
# it's a root
3400-
set tok [lindex $varctok($curview) $a]
3400+
set tok [lindex $varctok($curview) $varcid($curview,$p)]
34013401
break
34023402
}
34033403
if {[llength $parents($curview,$id)] == 1} {
@@ -7028,6 +7028,7 @@ proc cherrypick {} {
70287028
}
70297029
redrawtags $oldhead
70307030
redrawtags $newhead
7031+
selbyid $newhead
70317032
}
70327033
notbusy cherrypick
70337034
}
@@ -7072,6 +7073,7 @@ proc resethead {} {
70727073
dohidelocalchanges
70737074
filerun $fd [list readresetstat $fd]
70747075
nowbusy reset [mc "Resetting"]
7076+
selbyid $rowmenuid
70757077
}
70767078
}
70777079

@@ -7144,6 +7146,7 @@ proc cobranch {} {
71447146
redrawtags $headids($oldmainhead)
71457147
}
71467148
redrawtags $headmenuid
7149+
selbyid $headmenuid
71477150
}
71487151
if {$showlocalchanges} {
71497152
dodiffindex

0 commit comments

Comments
 (0)