@@ -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
}
@@ -9911,7 +9911,8 @@ proc getallcommits {} {
9911
9911
}
9912
9912
}
9913
9913
if {$ids ne {}} {
9914
- set fd [open [concat $cmd $ids ] r]
9914
+ set cmd [limit_arg_length [concat $cmd $ids ]]
9915
+ set fd [open $cmd r]
9915
9916
fconfigure $fd -blocking 0
9916
9917
incr allcommits
9917
9918
nowbusy allcommits
@@ -9921,6 +9922,21 @@ proc getallcommits {} {
9921
9922
}
9922
9923
}
9923
9924
9925
+ # The maximum command line length for the CreateProcess function is 32767 characters, see
9926
+ # http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
9927
+ # Be a little conservative in case Tcl adds some more stuff to the command line we do not
9928
+ # know about and truncate the command line at a SHA1-boundary below 32000 characters.
9929
+ proc limit_arg_length {cmd} {
9930
+ if {[tk windowingsystem] == " win32" &&
9931
+ [string length $cmd ] > 32000} {
9932
+ set ndx [string last " " $cmd 32000]
9933
+ if {$ndx != -1} {
9934
+ return [string range $cmd 0 $ndx ]
9935
+ }
9936
+ }
9937
+ return $cmd
9938
+ }
9939
+
9924
9940
# Since most commits have 1 parent and 1 child, we group strings of
9925
9941
# such commits into "arcs" joining branch/merge points (BMPs), which
9926
9942
# are commits that either don't have 1 parent or don't have 1 child.
@@ -12077,7 +12093,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
12077
12093
set gitk_prefix [file dirname [file dirname [file normalize $argv0 ]]]
12078
12094
set gitk_libdir [file join $gitk_prefix share gitk lib]
12079
12095
set gitk_msgsdir [file join $gitk_libdir msgs]
12080
- unset gitk_prefix
12081
12096
}
12082
12097
12083
12098
# # Internationalization (i18n) through msgcat and gettext. See
@@ -12269,28 +12284,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
12269
12284
set worktree [exec git rev-parse --show-toplevel]
12270
12285
setcoords
12271
12286
makewindow
12272
- catch {
12273
- image create photo gitlogo -width 16 -height 16
12274
-
12275
- image create photo gitlogominus -width 4 -height 2
12276
- gitlogominus put #C00000 -to 0 0 4 2
12277
- gitlogo copy gitlogominus -to 1 5
12278
- gitlogo copy gitlogominus -to 6 5
12279
- gitlogo copy gitlogominus -to 11 5
12280
- image delete gitlogominus
12281
-
12282
- image create photo gitlogoplus -width 4 -height 4
12283
- gitlogoplus put #008000 -to 1 0 3 4
12284
- gitlogoplus put #008000 -to 0 1 4 3
12285
- gitlogo copy gitlogoplus -to 1 9
12286
- gitlogo copy gitlogoplus -to 6 9
12287
- gitlogo copy gitlogoplus -to 11 9
12288
- image delete gitlogoplus
12289
-
12290
- image create photo gitlogo32 -width 32 -height 32
12291
- gitlogo32 copy gitlogo -zoom 2 2
12292
-
12293
- wm iconphoto . -default gitlogo gitlogo32
12287
+ if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix /etc/git.ico]} {
12288
+ wm iconbitmap . -default $gitk_prefix /etc/git.ico
12289
+ } else {
12290
+ catch {
12291
+ image create photo gitlogo -width 16 -height 16
12292
+
12293
+ image create photo gitlogominus -width 4 -height 2
12294
+ gitlogominus put #C00000 -to 0 0 4 2
12295
+ gitlogo copy gitlogominus -to 1 5
12296
+ gitlogo copy gitlogominus -to 6 5
12297
+ gitlogo copy gitlogominus -to 11 5
12298
+ image delete gitlogominus
12299
+
12300
+ image create photo gitlogoplus -width 4 -height 4
12301
+ gitlogoplus put #008000 -to 1 0 3 4
12302
+ gitlogoplus put #008000 -to 0 1 4 3
12303
+ gitlogo copy gitlogoplus -to 1 9
12304
+ gitlogo copy gitlogoplus -to 6 9
12305
+ gitlogo copy gitlogoplus -to 11 9
12306
+ image delete gitlogoplus
12307
+
12308
+ image create photo gitlogo32 -width 32 -height 32
12309
+ gitlogo32 copy gitlogo -zoom 2 2
12310
+
12311
+ wm iconphoto . -default gitlogo gitlogo32
12312
+ }
12294
12313
}
12295
12314
# wait for the window to become visible
12296
12315
tkwait visibility .
0 commit comments