@@ -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
}
@@ -9910,18 +9910,7 @@ proc getallcommits {} {
9910
9910
}
9911
9911
}
9912
9912
if {$ids ne {}} {
9913
- set cmd [concat $cmd $ids ]
9914
- # The maximum command line length for the CreateProcess function is 32767 characters, see
9915
- # http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
9916
- # Be a little conservative in case Tcl adds some more stuff to the command line we do not
9917
- # know about and truncate the command line at a SHA1-boundary below 32000 characters.
9918
- if {[tk windowingsystem] == " win32" &&
9919
- [string length $cmd ] > 32000} {
9920
- set ndx [string last " " $cmd 32000]
9921
- if {$ndx != -1} {
9922
- set cmd [string range $cmd 0 $ndx ]
9923
- }
9924
- }
9913
+ set cmd [limit_arg_length [concat $cmd $ids ]]
9925
9914
set fd [open $cmd r]
9926
9915
fconfigure $fd -blocking 0
9927
9916
incr allcommits
@@ -9932,6 +9921,21 @@ proc getallcommits {} {
9932
9921
}
9933
9922
}
9934
9923
9924
+ # The maximum command line length for the CreateProcess function is 32767 characters, see
9925
+ # http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
9926
+ # Be a little conservative in case Tcl adds some more stuff to the command line we do not
9927
+ # know about and truncate the command line at a SHA1-boundary below 32000 characters.
9928
+ proc limit_arg_length {cmd} {
9929
+ if {[tk windowingsystem] == " win32" &&
9930
+ [string length $cmd ] > 32000} {
9931
+ set ndx [string last " " $cmd 32000]
9932
+ if {$ndx != -1} {
9933
+ return [string range $cmd 0 $ndx ]
9934
+ }
9935
+ }
9936
+ return $cmd
9937
+ }
9938
+
9935
9939
# Since most commits have 1 parent and 1 child, we group strings of
9936
9940
# such commits into "arcs" joining branch/merge points (BMPs), which
9937
9941
# are commits that either don't have 1 parent or don't have 1 child.
0 commit comments