@@ -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
}
@@ -10039,18 +10039,7 @@ proc getallcommits {} {
10039
10039
}
10040
10040
}
10041
10041
if {$ids ne {}} {
10042
- set cmd [concat $cmd $ids ]
10043
- # The maximum command line length for the CreateProcess function is 32767 characters, see
10044
- # http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
10045
- # Be a little conservative in case Tcl adds some more stuff to the command line we do not
10046
- # know about and truncate the command line at a SHA1-boundary below 32000 characters.
10047
- if {[tk windowingsystem] == " win32" &&
10048
- [string length $cmd ] > 32000} {
10049
- set ndx [string last " " $cmd 32000]
10050
- if {$ndx != -1} {
10051
- set cmd [string range $cmd 0 $ndx ]
10052
- }
10053
- }
10042
+ set cmd [limit_arg_length [concat $cmd $ids ]]
10054
10043
set fd [open $cmd r]
10055
10044
fconfigure $fd -blocking 0
10056
10045
incr allcommits
@@ -10061,6 +10050,21 @@ proc getallcommits {} {
10061
10050
}
10062
10051
}
10063
10052
10053
+ # The maximum command line length for the CreateProcess function is 32767 characters, see
10054
+ # http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
10055
+ # Be a little conservative in case Tcl adds some more stuff to the command line we do not
10056
+ # know about and truncate the command line at a SHA1-boundary below 32000 characters.
10057
+ proc limit_arg_length {cmd} {
10058
+ if {[tk windowingsystem] == " win32" &&
10059
+ [string length $cmd ] > 32000} {
10060
+ set ndx [string last " " $cmd 32000]
10061
+ if {$ndx != -1} {
10062
+ return [string range $cmd 0 $ndx ]
10063
+ }
10064
+ }
10065
+ return $cmd
10066
+ }
10067
+
10064
10068
# Since most commits have 1 parent and 1 child, we group strings of
10065
10069
# such commits into "arcs" joining branch/merge points (BMPs), which
10066
10070
# are commits that either don't have 1 parent or don't have 1 child.
0 commit comments