@@ -404,7 +404,7 @@ proc start_rev_list {view} {
404
404
if {$revs eq {}} {
405
405
return 0
406
406
}
407
- set args [concat $vflags($view) $revs ]
407
+ set args [limit_arg_length [ concat $vflags($view) $revs ] ]
408
408
} else {
409
409
set args $vorigargs($view)
410
410
}
@@ -9935,7 +9935,8 @@ proc getallcommits {} {
9935
9935
}
9936
9936
}
9937
9937
if {$ids ne {}} {
9938
- set fd [open [concat $cmd $ids ] r]
9938
+ set cmd [limit_arg_length [concat $cmd $ids ]]
9939
+ set fd [open $cmd r]
9939
9940
fconfigure $fd -blocking 0
9940
9941
incr allcommits
9941
9942
nowbusy allcommits
@@ -9945,6 +9946,21 @@ proc getallcommits {} {
9945
9946
}
9946
9947
}
9947
9948
9949
+ # The maximum command line length for the CreateProcess function is 32767 characters, see
9950
+ # http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
9951
+ # Be a little conservative in case Tcl adds some more stuff to the command line we do not
9952
+ # know about and truncate the command line at a SHA1-boundary below 32000 characters.
9953
+ proc limit_arg_length {cmd} {
9954
+ if {[tk windowingsystem] == " win32" &&
9955
+ [string length $cmd ] > 32000} {
9956
+ set ndx [string last " " $cmd 32000]
9957
+ if {$ndx != -1} {
9958
+ return [string range $cmd 0 $ndx ]
9959
+ }
9960
+ }
9961
+ return $cmd
9962
+ }
9963
+
9948
9964
# Since most commits have 1 parent and 1 child, we group strings of
9949
9965
# such commits into "arcs" joining branch/merge points (BMPs), which
9950
9966
# are commits that either don't have 1 parent or don't have 1 child.
@@ -12078,7 +12094,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
12078
12094
set gitk_prefix [file dirname [file dirname [file normalize $argv0 ]]]
12079
12095
set gitk_libdir [file join $gitk_prefix share gitk lib]
12080
12096
set gitk_msgsdir [file join $gitk_libdir msgs]
12081
- unset gitk_prefix
12082
12097
}
12083
12098
12084
12099
# # Internationalization (i18n) through msgcat and gettext. See
@@ -12257,28 +12272,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
12257
12272
set worktree [exec git rev-parse --show-toplevel]
12258
12273
setcoords
12259
12274
makewindow
12260
- catch {
12261
- image create photo gitlogo -width 16 -height 16
12262
-
12263
- image create photo gitlogominus -width 4 -height 2
12264
- gitlogominus put #C00000 -to 0 0 4 2
12265
- gitlogo copy gitlogominus -to 1 5
12266
- gitlogo copy gitlogominus -to 6 5
12267
- gitlogo copy gitlogominus -to 11 5
12268
- image delete gitlogominus
12269
-
12270
- image create photo gitlogoplus -width 4 -height 4
12271
- gitlogoplus put #008000 -to 1 0 3 4
12272
- gitlogoplus put #008000 -to 0 1 4 3
12273
- gitlogo copy gitlogoplus -to 1 9
12274
- gitlogo copy gitlogoplus -to 6 9
12275
- gitlogo copy gitlogoplus -to 11 9
12276
- image delete gitlogoplus
12277
-
12278
- image create photo gitlogo32 -width 32 -height 32
12279
- gitlogo32 copy gitlogo -zoom 2 2
12280
-
12281
- wm iconphoto . -default gitlogo gitlogo32
12275
+ if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix /etc/git.ico]} {
12276
+ wm iconbitmap . -default $gitk_prefix /etc/git.ico
12277
+ } else {
12278
+ catch {
12279
+ image create photo gitlogo -width 16 -height 16
12280
+
12281
+ image create photo gitlogominus -width 4 -height 2
12282
+ gitlogominus put #C00000 -to 0 0 4 2
12283
+ gitlogo copy gitlogominus -to 1 5
12284
+ gitlogo copy gitlogominus -to 6 5
12285
+ gitlogo copy gitlogominus -to 11 5
12286
+ image delete gitlogominus
12287
+
12288
+ image create photo gitlogoplus -width 4 -height 4
12289
+ gitlogoplus put #008000 -to 1 0 3 4
12290
+ gitlogoplus put #008000 -to 0 1 4 3
12291
+ gitlogo copy gitlogoplus -to 1 9
12292
+ gitlogo copy gitlogoplus -to 6 9
12293
+ gitlogo copy gitlogoplus -to 11 9
12294
+ image delete gitlogoplus
12295
+
12296
+ image create photo gitlogo32 -width 32 -height 32
12297
+ gitlogo32 copy gitlogo -zoom 2 2
12298
+
12299
+ wm iconphoto . -default gitlogo gitlogo32
12300
+ }
12282
12301
}
12283
12302
# wait for the window to become visible
12284
12303
tkwait visibility .
0 commit comments