@@ -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
}
@@ -10058,7 +10058,8 @@ proc getallcommits {} {
10058
10058
}
10059
10059
}
10060
10060
if {$ids ne {}} {
10061
- set fd [open [concat $cmd $ids ] r]
10061
+ set cmd [limit_arg_length [concat $cmd $ids ]]
10062
+ set fd [open $cmd r]
10062
10063
fconfigure $fd -blocking 0
10063
10064
incr allcommits
10064
10065
nowbusy allcommits
@@ -10068,6 +10069,21 @@ proc getallcommits {} {
10068
10069
}
10069
10070
}
10070
10071
10072
+ # The maximum command line length for the CreateProcess function is 32767 characters, see
10073
+ # http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
10074
+ # Be a little conservative in case Tcl adds some more stuff to the command line we do not
10075
+ # know about and truncate the command line at a SHA1-boundary below 32000 characters.
10076
+ proc limit_arg_length {cmd} {
10077
+ if {[tk windowingsystem] == " win32" &&
10078
+ [string length $cmd ] > 32000} {
10079
+ set ndx [string last " " $cmd 32000]
10080
+ if {$ndx != -1} {
10081
+ return [string range $cmd 0 $ndx ]
10082
+ }
10083
+ }
10084
+ return $cmd
10085
+ }
10086
+
10071
10087
# Since most commits have 1 parent and 1 child, we group strings of
10072
10088
# such commits into "arcs" joining branch/merge points (BMPs), which
10073
10089
# 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
@@ -12433,28 +12448,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
12433
12448
set worktree [exec git rev-parse --show-toplevel]
12434
12449
setcoords
12435
12450
makewindow
12436
- catch {
12437
- image create photo gitlogo -width 16 -height 16
12438
-
12439
- image create photo gitlogominus -width 4 -height 2
12440
- gitlogominus put #C00000 -to 0 0 4 2
12441
- gitlogo copy gitlogominus -to 1 5
12442
- gitlogo copy gitlogominus -to 6 5
12443
- gitlogo copy gitlogominus -to 11 5
12444
- image delete gitlogominus
12445
-
12446
- image create photo gitlogoplus -width 4 -height 4
12447
- gitlogoplus put #008000 -to 1 0 3 4
12448
- gitlogoplus put #008000 -to 0 1 4 3
12449
- gitlogo copy gitlogoplus -to 1 9
12450
- gitlogo copy gitlogoplus -to 6 9
12451
- gitlogo copy gitlogoplus -to 11 9
12452
- image delete gitlogoplus
12453
-
12454
- image create photo gitlogo32 -width 32 -height 32
12455
- gitlogo32 copy gitlogo -zoom 2 2
12456
-
12457
- wm iconphoto . -default gitlogo gitlogo32
12451
+ if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix /etc/git.ico]} {
12452
+ wm iconbitmap . -default $gitk_prefix /etc/git.ico
12453
+ } else {
12454
+ catch {
12455
+ image create photo gitlogo -width 16 -height 16
12456
+
12457
+ image create photo gitlogominus -width 4 -height 2
12458
+ gitlogominus put #C00000 -to 0 0 4 2
12459
+ gitlogo copy gitlogominus -to 1 5
12460
+ gitlogo copy gitlogominus -to 6 5
12461
+ gitlogo copy gitlogominus -to 11 5
12462
+ image delete gitlogominus
12463
+
12464
+ image create photo gitlogoplus -width 4 -height 4
12465
+ gitlogoplus put #008000 -to 1 0 3 4
12466
+ gitlogoplus put #008000 -to 0 1 4 3
12467
+ gitlogo copy gitlogoplus -to 1 9
12468
+ gitlogo copy gitlogoplus -to 6 9
12469
+ gitlogo copy gitlogoplus -to 11 9
12470
+ image delete gitlogoplus
12471
+
12472
+ image create photo gitlogo32 -width 32 -height 32
12473
+ gitlogo32 copy gitlogo -zoom 2 2
12474
+
12475
+ wm iconphoto . -default gitlogo gitlogo32
12476
+ }
12458
12477
}
12459
12478
# wait for the window to become visible
12460
12479
tkwait visibility .
0 commit comments