@@ -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
}
@@ -10040,7 +10040,8 @@ proc getallcommits {} {
10040
10040
}
10041
10041
}
10042
10042
if {$ids ne {}} {
10043
- set fd [open [concat $cmd $ids ] r]
10043
+ set cmd [limit_arg_length [concat $cmd $ids ]]
10044
+ set fd [open $cmd r]
10044
10045
fconfigure $fd -blocking 0
10045
10046
incr allcommits
10046
10047
nowbusy allcommits
@@ -10050,6 +10051,21 @@ proc getallcommits {} {
10050
10051
}
10051
10052
}
10052
10053
10054
+ # The maximum command line length for the CreateProcess function is 32767 characters, see
10055
+ # http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
10056
+ # Be a little conservative in case Tcl adds some more stuff to the command line we do not
10057
+ # know about and truncate the command line at a SHA1-boundary below 32000 characters.
10058
+ proc limit_arg_length {cmd} {
10059
+ if {[tk windowingsystem] == " win32" &&
10060
+ [string length $cmd ] > 32000} {
10061
+ set ndx [string last " " $cmd 32000]
10062
+ if {$ndx != -1} {
10063
+ return [string range $cmd 0 $ndx ]
10064
+ }
10065
+ }
10066
+ return $cmd
10067
+ }
10068
+
10053
10069
# Since most commits have 1 parent and 1 child, we group strings of
10054
10070
# such commits into "arcs" joining branch/merge points (BMPs), which
10055
10071
# are commits that either don't have 1 parent or don't have 1 child.
@@ -12060,7 +12076,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
12060
12076
set gitk_prefix [file dirname [file dirname [file normalize $argv0 ]]]
12061
12077
set gitk_libdir [file join $gitk_prefix share gitk lib]
12062
12078
set gitk_msgsdir [file join $gitk_libdir msgs]
12063
- unset gitk_prefix
12064
12079
}
12065
12080
12066
12081
# # Internationalization (i18n) through msgcat and gettext. See
@@ -12411,28 +12426,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
12411
12426
set worktree [exec git rev-parse --show-toplevel]
12412
12427
setcoords
12413
12428
makewindow
12414
- catch {
12415
- image create photo gitlogo -width 16 -height 16
12416
-
12417
- image create photo gitlogominus -width 4 -height 2
12418
- gitlogominus put #C00000 -to 0 0 4 2
12419
- gitlogo copy gitlogominus -to 1 5
12420
- gitlogo copy gitlogominus -to 6 5
12421
- gitlogo copy gitlogominus -to 11 5
12422
- image delete gitlogominus
12423
-
12424
- image create photo gitlogoplus -width 4 -height 4
12425
- gitlogoplus put #008000 -to 1 0 3 4
12426
- gitlogoplus put #008000 -to 0 1 4 3
12427
- gitlogo copy gitlogoplus -to 1 9
12428
- gitlogo copy gitlogoplus -to 6 9
12429
- gitlogo copy gitlogoplus -to 11 9
12430
- image delete gitlogoplus
12431
-
12432
- image create photo gitlogo32 -width 32 -height 32
12433
- gitlogo32 copy gitlogo -zoom 2 2
12434
-
12435
- wm iconphoto . -default gitlogo gitlogo32
12429
+ if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix /etc/git.ico]} {
12430
+ wm iconbitmap . -default $gitk_prefix /etc/git.ico
12431
+ } else {
12432
+ catch {
12433
+ image create photo gitlogo -width 16 -height 16
12434
+
12435
+ image create photo gitlogominus -width 4 -height 2
12436
+ gitlogominus put #C00000 -to 0 0 4 2
12437
+ gitlogo copy gitlogominus -to 1 5
12438
+ gitlogo copy gitlogominus -to 6 5
12439
+ gitlogo copy gitlogominus -to 11 5
12440
+ image delete gitlogominus
12441
+
12442
+ image create photo gitlogoplus -width 4 -height 4
12443
+ gitlogoplus put #008000 -to 1 0 3 4
12444
+ gitlogoplus put #008000 -to 0 1 4 3
12445
+ gitlogo copy gitlogoplus -to 1 9
12446
+ gitlogo copy gitlogoplus -to 6 9
12447
+ gitlogo copy gitlogoplus -to 11 9
12448
+ image delete gitlogoplus
12449
+
12450
+ image create photo gitlogo32 -width 32 -height 32
12451
+ gitlogo32 copy gitlogo -zoom 2 2
12452
+
12453
+ wm iconphoto . -default gitlogo gitlogo32
12454
+ }
12436
12455
}
12437
12456
# wait for the window to become visible
12438
12457
tkwait visibility .
0 commit comments