@@ -406,7 +406,7 @@ proc start_rev_list {view} {
406
406
if {$revs eq {}} {
407
407
return 0
408
408
}
409
- set args [concat $vflags($view) $revs ]
409
+ set args [limit_arg_length [ concat $vflags($view) $revs ] ]
410
410
} else {
411
411
set args $vorigargs($view)
412
412
}
@@ -2076,7 +2076,7 @@ proc makewindow {} {
2076
2076
global headctxmenu progresscanv progressitem progresscoords statusw
2077
2077
global fprogitem fprogcoord lastprogupdate progupdatepending
2078
2078
global rprogitem rprogcoord rownumsel numcommits
2079
- global have_tk85 use_ttk NS
2079
+ global have_tk85 have_tk86 use_ttk NS
2080
2080
global git_version
2081
2081
global worddiff
2082
2082
@@ -2566,8 +2566,13 @@ proc makewindow {} {
2566
2566
bind . <Key-Down> " selnextline 1"
2567
2567
bind . <Shift-Key-Up> " dofind -1 0"
2568
2568
bind . <Shift-Key-Down> " dofind 1 0"
2569
- bindkey <Key-Right> " goforw"
2570
- bindkey <Key-Left> " goback"
2569
+ if {$have_tk86 } {
2570
+ bindkey <<NextChar>> " goforw"
2571
+ bindkey <<PrevChar>> " goback"
2572
+ } else {
2573
+ bindkey <Key-Right> " goforw"
2574
+ bindkey <Key-Left> " goback"
2575
+ }
2571
2576
bind . <Key-Prior> " selnextpage -1"
2572
2577
bind . <Key-Next> " selnextpage 1"
2573
2578
bind . <$M1B -Home> " allcanvs yview moveto 0.0"
@@ -7634,7 +7639,7 @@ proc gettreeline {gtf id} {
7634
7639
if {[string index $fname 0] eq " \" " } {
7635
7640
set fname [lindex $fname 0]
7636
7641
}
7637
- set fname [encoding convertfrom $fname ]
7642
+ set fname [encoding convertfrom utf-8 $fname ]
7638
7643
lappend treefilelist($id ) $fname
7639
7644
}
7640
7645
if {![eof $gtf ]} {
@@ -7896,7 +7901,7 @@ proc gettreediffline {gdtf ids} {
7896
7901
if {[string index $file 0] eq " \" " } {
7897
7902
set file [lindex $file 0]
7898
7903
}
7899
- set file [encoding convertfrom $file ]
7904
+ set file [encoding convertfrom utf-8 $file ]
7900
7905
if {$file ne [lindex $treediff end]} {
7901
7906
lappend treediff $file
7902
7907
lappend sublist $file
@@ -8041,7 +8046,7 @@ proc makediffhdr {fname ids} {
8041
8046
global ctext curdiffstart treediffs diffencoding
8042
8047
global ctext_file_names jump_to_here targetline diffline
8043
8048
8044
- set fname [encoding convertfrom $fname ]
8049
+ set fname [encoding convertfrom utf-8 $fname ]
8045
8050
set diffencoding [get_path_encoding $fname ]
8046
8051
set i [lsearch -exact $treediffs($ids) $fname ]
8047
8052
if {$i >= 0} {
@@ -8103,7 +8108,7 @@ proc parseblobdiffline {ids line} {
8103
8108
8104
8109
if {![string compare -length 5 " diff " $line ]} {
8105
8110
if {![regexp {^diff (--cc|--git) } $line m type]} {
8106
- set line [encoding convertfrom $line ]
8111
+ set line [encoding convertfrom utf-8 $line ]
8107
8112
$ctext insert end " $line \n " hunksep
8108
8113
continue
8109
8114
}
@@ -8150,7 +8155,7 @@ proc parseblobdiffline {ids line} {
8150
8155
makediffhdr $fname $ids
8151
8156
8152
8157
} elseif {![string compare -length 16 " * Unmerged path " $line ]} {
8153
- set fname [encoding convertfrom [string range $line 16 end]]
8158
+ set fname [encoding convertfrom utf-8 [string range $line 16 end]]
8154
8159
$ctext insert end " \n "
8155
8160
set curdiffstart [$ctext index " end - 1c" ]
8156
8161
lappend ctext_file_names $fname
@@ -8205,7 +8210,7 @@ proc parseblobdiffline {ids line} {
8205
8210
if {[string index $fname 0] eq " \" " } {
8206
8211
set fname [lindex $fname 0]
8207
8212
}
8208
- set fname [encoding convertfrom $fname ]
8213
+ set fname [encoding convertfrom utf-8 $fname ]
8209
8214
set i [lsearch -exact $treediffs($ids) $fname ]
8210
8215
if {$i >= 0} {
8211
8216
setinlist difffilestart $i $curdiffstart
@@ -8224,6 +8229,7 @@ proc parseblobdiffline {ids line} {
8224
8229
set diffinhdr 0
8225
8230
return
8226
8231
}
8232
+ set line [encoding convertfrom utf-8 $line ]
8227
8233
$ctext insert end " $line \n " filesep
8228
8234
8229
8235
} else {
@@ -9982,7 +9988,7 @@ proc showrefs {} {
9982
9988
text $top .list -background $bgcolor -foreground $fgcolor \
9983
9989
-selectbackground $selectbgcolor -font mainfont \
9984
9990
-xscrollcommand " $top .xsb set" -yscrollcommand " $top .ysb set" \
9985
- -width 30 -height 20 -cursor $maincursor \
9991
+ -width 60 -height 20 -cursor $maincursor \
9986
9992
-spacing1 1 -spacing3 1 -state disabled
9987
9993
$top .list tag configure highlight -background $selectbgcolor
9988
9994
if {![lsearch -exact $bglist $top .list]} {
@@ -10171,7 +10177,8 @@ proc getallcommits {} {
10171
10177
}
10172
10178
}
10173
10179
if {$ids ne {}} {
10174
- set fd [open [concat $cmd $ids ] r]
10180
+ set cmd [limit_arg_length [concat $cmd $ids ]]
10181
+ set fd [open $cmd r]
10175
10182
fconfigure $fd -blocking 0
10176
10183
incr allcommits
10177
10184
nowbusy allcommits
@@ -10181,6 +10188,21 @@ proc getallcommits {} {
10181
10188
}
10182
10189
}
10183
10190
10191
+ # The maximum command line length for the CreateProcess function is 32767 characters, see
10192
+ # http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
10193
+ # Be a little conservative in case Tcl adds some more stuff to the command line we do not
10194
+ # know about and truncate the command line at a SHA1-boundary below 32000 characters.
10195
+ proc limit_arg_length {cmd} {
10196
+ if {[tk windowingsystem] == " win32" &&
10197
+ [string length $cmd ] > 32000} {
10198
+ set ndx [string last " " $cmd 32000]
10199
+ if {$ndx != -1} {
10200
+ return [string range $cmd 0 $ndx ]
10201
+ }
10202
+ }
10203
+ return $cmd
10204
+ }
10205
+
10184
10206
# Since most commits have 1 parent and 1 child, we group strings of
10185
10207
# such commits into "arcs" joining branch/merge points (BMPs), which
10186
10208
# are commits that either don't have 1 parent or don't have 1 child.
@@ -12161,7 +12183,7 @@ proc cache_gitattr {attr pathlist} {
12161
12183
foreach row [split $rlist " \n " ] {
12162
12184
if {[regexp "(.*): $attr : (.*)" $row m path value]} {
12163
12185
if {[string index $path 0] eq " \" " } {
12164
- set path [encoding convertfrom [lindex $path 0]]
12186
+ set path [encoding convertfrom utf-8 [lindex $path 0]]
12165
12187
}
12166
12188
set path_attr_cache($attr ,$path ) $value
12167
12189
}
@@ -12191,7 +12213,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
12191
12213
set gitk_prefix [file dirname [file dirname [file normalize $argv0 ]]]
12192
12214
set gitk_libdir [file join $gitk_prefix share gitk lib]
12193
12215
set gitk_msgsdir [file join $gitk_libdir msgs]
12194
- unset gitk_prefix
12195
12216
}
12196
12217
12197
12218
# # Internationalization (i18n) through msgcat and gettext. See
@@ -12482,6 +12503,7 @@ set nullid2 "0000000000000000000000000000000000000001"
12482
12503
set nullfile " /dev/null"
12483
12504
12484
12505
set have_tk85 [expr {[package vcompare $tk_version " 8.5" ] >= 0}]
12506
+ set have_tk86 [expr {[package vcompare $tk_version " 8.6" ] >= 0}]
12485
12507
if {![info exists have_ttk]} {
12486
12508
set have_ttk [llength [info commands ::ttk::style]]
12487
12509
}
@@ -12546,28 +12568,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
12546
12568
set worktree [exec git rev-parse --show-toplevel]
12547
12569
setcoords
12548
12570
makewindow
12549
- catch {
12550
- image create photo gitlogo -width 16 -height 16
12551
-
12552
- image create photo gitlogominus -width 4 -height 2
12553
- gitlogominus put #C00000 -to 0 0 4 2
12554
- gitlogo copy gitlogominus -to 1 5
12555
- gitlogo copy gitlogominus -to 6 5
12556
- gitlogo copy gitlogominus -to 11 5
12557
- image delete gitlogominus
12558
-
12559
- image create photo gitlogoplus -width 4 -height 4
12560
- gitlogoplus put #008000 -to 1 0 3 4
12561
- gitlogoplus put #008000 -to 0 1 4 3
12562
- gitlogo copy gitlogoplus -to 1 9
12563
- gitlogo copy gitlogoplus -to 6 9
12564
- gitlogo copy gitlogoplus -to 11 9
12565
- image delete gitlogoplus
12566
-
12567
- image create photo gitlogo32 -width 32 -height 32
12568
- gitlogo32 copy gitlogo -zoom 2 2
12569
-
12570
- wm iconphoto . -default gitlogo gitlogo32
12571
+ if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix /etc/git.ico]} {
12572
+ wm iconbitmap . -default $gitk_prefix /etc/git.ico
12573
+ } else {
12574
+ catch {
12575
+ image create photo gitlogo -width 16 -height 16
12576
+
12577
+ image create photo gitlogominus -width 4 -height 2
12578
+ gitlogominus put #C00000 -to 0 0 4 2
12579
+ gitlogo copy gitlogominus -to 1 5
12580
+ gitlogo copy gitlogominus -to 6 5
12581
+ gitlogo copy gitlogominus -to 11 5
12582
+ image delete gitlogominus
12583
+
12584
+ image create photo gitlogoplus -width 4 -height 4
12585
+ gitlogoplus put #008000 -to 1 0 3 4
12586
+ gitlogoplus put #008000 -to 0 1 4 3
12587
+ gitlogo copy gitlogoplus -to 1 9
12588
+ gitlogo copy gitlogoplus -to 6 9
12589
+ gitlogo copy gitlogoplus -to 11 9
12590
+ image delete gitlogoplus
12591
+
12592
+ image create photo gitlogo32 -width 32 -height 32
12593
+ gitlogo32 copy gitlogo -zoom 2 2
12594
+
12595
+ wm iconphoto . -default gitlogo gitlogo32
12596
+ }
12571
12597
}
12572
12598
# wait for the window to become visible
12573
12599
tkwait visibility .
0 commit comments