From: Paul Mackerras Date: Tue, 15 Jan 2008 11:16:32 +0000 (+1100) Subject: gitk: Select something appropriate on cherry-pick, branch reset and checkout X-Git-Tag: v1.5.6-rc0~20^2~23 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=46308ea1da6794bef1a99b0b1c892c46dec40146;p=git.git 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 --- diff --git a/gitk b/gitk index 8b4c61c56..c707c3c10 100755 --- a/gitk +++ b/gitk @@ -3397,7 +3397,7 @@ proc ordertoken {id} { set id [first_real_child $curview,$p] if {$id eq {}} { # it's a root - set tok [lindex $varctok($curview) $a] + set tok [lindex $varctok($curview) $varcid($curview,$p)] break } if {[llength $parents($curview,$id)] == 1} { @@ -7028,6 +7028,7 @@ proc cherrypick {} { } redrawtags $oldhead redrawtags $newhead + selbyid $newhead } notbusy cherrypick } @@ -7072,6 +7073,7 @@ proc resethead {} { dohidelocalchanges filerun $fd [list readresetstat $fd] nowbusy reset [mc "Resetting"] + selbyid $rowmenuid } } @@ -7144,6 +7146,7 @@ proc cobranch {} { redrawtags $headids($oldmainhead) } redrawtags $headmenuid + selbyid $headmenuid } if {$showlocalchanges} { dodiffindex