@@ -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
}
@@ -9970,7 +9970,8 @@ proc getallcommits {} {
9970
9970
}
9971
9971
}
9972
9972
if {$ids ne {}} {
9973
- set fd [open [concat $cmd $ids ] r]
9973
+ set cmd [limit_arg_length [concat $cmd $ids ]]
9974
+ set fd [open $cmd r]
9974
9975
fconfigure $fd -blocking 0
9975
9976
incr allcommits
9976
9977
nowbusy allcommits
@@ -9980,6 +9981,21 @@ proc getallcommits {} {
9980
9981
}
9981
9982
}
9982
9983
9984
+ # The maximum command line length for the CreateProcess function is 32767 characters, see
9985
+ # http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
9986
+ # Be a little conservative in case Tcl adds some more stuff to the command line we do not
9987
+ # know about and truncate the command line at a SHA1-boundary below 32000 characters.
9988
+ proc limit_arg_length {cmd} {
9989
+ if {[tk windowingsystem] == " win32" &&
9990
+ [string length $cmd ] > 32000} {
9991
+ set ndx [string last " " $cmd 32000]
9992
+ if {$ndx != -1} {
9993
+ return [string range $cmd 0 $ndx ]
9994
+ }
9995
+ }
9996
+ return $cmd
9997
+ }
9998
+
9983
9999
# Since most commits have 1 parent and 1 child, we group strings of
9984
10000
# such commits into "arcs" joining branch/merge points (BMPs), which
9985
10001
# are commits that either don't have 1 parent or don't have 1 child.
@@ -12136,7 +12152,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
12136
12152
set gitk_prefix [file dirname [file dirname [file normalize $argv0 ]]]
12137
12153
set gitk_libdir [file join $gitk_prefix share gitk lib]
12138
12154
set gitk_msgsdir [file join $gitk_libdir msgs]
12139
- unset gitk_prefix
12140
12155
}
12141
12156
12142
12157
# # Internationalization (i18n) through msgcat and gettext. See
@@ -12315,28 +12330,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
12315
12330
set worktree [exec git rev-parse --show-toplevel]
12316
12331
setcoords
12317
12332
makewindow
12318
- catch {
12319
- image create photo gitlogo -width 16 -height 16
12320
-
12321
- image create photo gitlogominus -width 4 -height 2
12322
- gitlogominus put #C00000 -to 0 0 4 2
12323
- gitlogo copy gitlogominus -to 1 5
12324
- gitlogo copy gitlogominus -to 6 5
12325
- gitlogo copy gitlogominus -to 11 5
12326
- image delete gitlogominus
12327
-
12328
- image create photo gitlogoplus -width 4 -height 4
12329
- gitlogoplus put #008000 -to 1 0 3 4
12330
- gitlogoplus put #008000 -to 0 1 4 3
12331
- gitlogo copy gitlogoplus -to 1 9
12332
- gitlogo copy gitlogoplus -to 6 9
12333
- gitlogo copy gitlogoplus -to 11 9
12334
- image delete gitlogoplus
12335
-
12336
- image create photo gitlogo32 -width 32 -height 32
12337
- gitlogo32 copy gitlogo -zoom 2 2
12338
-
12339
- wm iconphoto . -default gitlogo gitlogo32
12333
+ if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix /etc/git.ico]} {
12334
+ wm iconbitmap . -default $gitk_prefix /etc/git.ico
12335
+ } else {
12336
+ catch {
12337
+ image create photo gitlogo -width 16 -height 16
12338
+
12339
+ image create photo gitlogominus -width 4 -height 2
12340
+ gitlogominus put #C00000 -to 0 0 4 2
12341
+ gitlogo copy gitlogominus -to 1 5
12342
+ gitlogo copy gitlogominus -to 6 5
12343
+ gitlogo copy gitlogominus -to 11 5
12344
+ image delete gitlogominus
12345
+
12346
+ image create photo gitlogoplus -width 4 -height 4
12347
+ gitlogoplus put #008000 -to 1 0 3 4
12348
+ gitlogoplus put #008000 -to 0 1 4 3
12349
+ gitlogo copy gitlogoplus -to 1 9
12350
+ gitlogo copy gitlogoplus -to 6 9
12351
+ gitlogo copy gitlogoplus -to 11 9
12352
+ image delete gitlogoplus
12353
+
12354
+ image create photo gitlogo32 -width 32 -height 32
12355
+ gitlogo32 copy gitlogo -zoom 2 2
12356
+
12357
+ wm iconphoto . -default gitlogo gitlogo32
12358
+ }
12340
12359
}
12341
12360
# wait for the window to become visible
12342
12361
tkwait visibility .
0 commit comments