@@ -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
}
@@ -9934,18 +9934,7 @@ proc getallcommits {} {
9934
9934
}
9935
9935
}
9936
9936
if {$ids ne {}} {
9937
- set cmd [concat $cmd $ids ]
9938
- # The maximum command line length for the CreateProcess function is 32767 characters, see
9939
- # http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
9940
- # Be a little conservative in case Tcl adds some more stuff to the command line we do not
9941
- # know about and truncate the command line at a SHA1-boundary below 32000 characters.
9942
- if {[tk windowingsystem] == " win32" &&
9943
- [string length $cmd ] > 32000} {
9944
- set ndx [string last " " $cmd 32000]
9945
- if {$ndx != -1} {
9946
- set cmd [string range $cmd 0 $ndx ]
9947
- }
9948
- }
9937
+ set cmd [limit_arg_length [concat $cmd $ids ]]
9949
9938
set fd [open $cmd r]
9950
9939
fconfigure $fd -blocking 0
9951
9940
incr allcommits
@@ -9956,6 +9945,21 @@ proc getallcommits {} {
9956
9945
}
9957
9946
}
9958
9947
9948
+ # The maximum command line length for the CreateProcess function is 32767 characters, see
9949
+ # http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
9950
+ # Be a little conservative in case Tcl adds some more stuff to the command line we do not
9951
+ # know about and truncate the command line at a SHA1-boundary below 32000 characters.
9952
+ proc limit_arg_length {cmd} {
9953
+ if {[tk windowingsystem] == " win32" &&
9954
+ [string length $cmd ] > 32000} {
9955
+ set ndx [string last " " $cmd 32000]
9956
+ if {$ndx != -1} {
9957
+ return [string range $cmd 0 $ndx ]
9958
+ }
9959
+ }
9960
+ return $cmd
9961
+ }
9962
+
9959
9963
# Since most commits have 1 parent and 1 child, we group strings of
9960
9964
# such commits into "arcs" joining branch/merge points (BMPs), which
9961
9965
# are commits that either don't have 1 parent or don't have 1 child.
0 commit comments