@@ -2652,7 +2652,7 @@ proc savestuff {w} {
26522652 global viewname viewfiles viewargs viewargscmd viewperm nextviewnum
26532653 global cmitmode wrapcomment datetimeformat limitdiffs
26542654 global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor
2655- global autoselect extdifftool perfile_attrs markbgcolor use_ttk
2655+ global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk
26562656 global hideremotes want_ttk
26572657
26582658 if {$stuffsaved } return
@@ -2673,6 +2673,7 @@ proc savestuff {w} {
26732673 puts $f [list set cmitmode $cmitmode ]
26742674 puts $f [list set wrapcomment $wrapcomment ]
26752675 puts $f [list set autoselect $autoselect ]
2676+ puts $f [list set autosellen $autosellen ]
26762677 puts $f [list set showneartags $showneartags ]
26772678 puts $f [list set hideremotes $hideremotes ]
26782679 puts $f [list set showlocalchanges $showlocalchanges ]
@@ -6300,6 +6301,7 @@ proc drawtags {id x xt y1} {
63006301 -width $lthickness -fill black -tags tag.$id ]
63016302 $canv lower $t
63026303 foreach tag $marks x $xvals wid $wvals {
6304+ set tag_quoted [string map {% %%} $tag ]
63036305 set xl [expr {$x + $delta }]
63046306 set xr [expr {$x + $delta + $wid + $lthickness }]
63056307 set font mainfont
@@ -6308,7 +6310,7 @@ proc drawtags {id x xt y1} {
63086310 set t [$canv create polygon $x [expr {$yt + $delta }] $xl $yt \
63096311 $xr $yt $xr $yb $xl $yb $x [expr {$yb - $delta }] \
63106312 -width 1 -outline black -fill yellow -tags tag.$id ]
6311- $canv bind $t <1> [list showtag $tag 1]
6313+ $canv bind $t <1> [list showtag $tag_quoted 1]
63126314 set rowtextx([rowofcommit $id ]) [expr {$xr + $linespc }]
63136315 } else {
63146316 # draw a head or other ref
@@ -6335,9 +6337,9 @@ proc drawtags {id x xt y1} {
63356337 set t [$canv create text $xl $y1 -anchor w -text $tag -fill $fgcolor \
63366338 -font $font -tags [list tag.$id text]]
63376339 if {$ntags >= 0} {
6338- $canv bind $t <1> [list showtag $tag 1]
6340+ $canv bind $t <1> [list showtag $tag_quoted 1]
63396341 } elseif {$nheads >= 0} {
6340- $canv bind $t $ctxbut [list headmenu %X %Y $id $tag ]
6342+ $canv bind $t $ctxbut [list headmenu %X %Y $id $tag_quoted ]
63416343 }
63426344 }
63436345 return $xt
@@ -6896,7 +6898,7 @@ proc selectline {l isnew {desired_loc {}}} {
68966898 global mergemax numcommits pending_select
68976899 global cmitmode showneartags allcommits
68986900 global targetrow targetid lastscrollrows
6899- global autoselect jump_to_here
6901+ global autoselect autosellen jump_to_here
69006902
69016903 catch {unset pending_select}
69026904 $canv delete hover
@@ -6958,7 +6960,7 @@ proc selectline {l isnew {desired_loc {}}} {
69586960 $sha1entry delete 0 end
69596961 $sha1entry insert 0 $id
69606962 if {$autoselect } {
6961- $sha1entry selection range 0 end
6963+ $sha1entry selection range 0 $autosellen
69626964 }
69636965 rhighlight_sel $id
69646966
@@ -9063,7 +9065,7 @@ proc cherrypick {} {
90639065 to file '%s'.\n Please commit, reset or stash\
90649066 your changes and try again." $fname ]
90659067 } elseif {[regexp -line \
9066- {^(CONFLICT \(.*\):|Automatic cherry-pick failed)} \
9068+ {^(CONFLICT \(.*\):|Automatic cherry-pick failed|error: could not apply )} \
90679069 $err ]} {
90689070 if {[confirm_popup [mc " Cherry-pick failed because of merge\
90699071 conflict.\n Do you wish to run git citool to\
@@ -10756,7 +10758,7 @@ proc doprefs {} {
1075610758 global maxwidth maxgraphpct use_ttk NS
1075710759 global oldprefs prefstop showneartags showlocalchanges
1075810760 global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
10759- global tabstop limitdiffs autoselect extdifftool perfile_attrs
10761+ global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
1076010762 global hideremotes want_ttk have_ttk
1076110763
1076210764 set top .gitkprefs
@@ -10784,9 +10786,10 @@ proc doprefs {} {
1078410786 ${NS} ::checkbutton $top .showlocal -text [mc " Show local changes" ] \
1078510787 -variable showlocalchanges
1078610788 grid x $top .showlocal -sticky w
10787- ${NS} ::checkbutton $top .autoselect -text [mc " Auto-select SHA1" ] \
10789+ ${NS} ::checkbutton $top .autoselect -text [mc " Auto-select SHA1 (length) " ] \
1078810790 -variable autoselect
10789- grid x $top .autoselect -sticky w
10791+ spinbox $top .autosellen -from 1 -to 40 -width 4 -textvariable autosellen
10792+ grid x $top .autoselect $top .autosellen -sticky w
1079010793 ${NS} ::checkbutton $top .hideremotes -text [mc " Hide remote refs" ] \
1079110794 -variable hideremotes
1079210795 grid x $top .hideremotes -sticky w
@@ -11428,6 +11431,7 @@ set showlocalchanges 1
1142811431set limitdiffs 1
1142911432set datetimeformat " %Y-%m-%d %H:%M:%S"
1143011433set autoselect 1
11434+ set autosellen 40
1143111435set perfile_attrs 0
1143211436set want_ttk 1
1143311437
@@ -11581,7 +11585,7 @@ if {![info exists have_ttk]} {
1158111585set use_ttk [expr {$have_ttk && $want_ttk }]
1158211586set NS [expr {$use_ttk ? " ttk" : " " }]
1158311587
11584- set git_version [ join [ lrange [ split [ lindex [ exec git version] end] .] 0 2] .]
11588+ regexp {^git version ([\d.]*\d)} [ exec git version] _ git_version
1158511589
1158611590set show_notes {}
1158711591if {[package vcompare $git_version " 1.6.6.2" ] >= 0} {
0 commit comments