From: Junio C Hamano Date: Wed, 12 Dec 2007 09:21:14 GMT Subject: Re: git-cvsexportcommit fails for huge commits Message-ID: <7vir348e0l.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20071212083154.GB7676@coredump.intra.peff.net> Jeff King writes: > @@ -335,6 +335,22 @@ sub safe_pipe_capture { > return wantarray ? @output : join('',@output); > } > > +sub xargs_safe_pipe_capture { > + my $MAX_ARG_LENGTH = 1024; > + my $cmd = shift; > + my @output; > + while(@_) { > + my @args; > + my $length = 0; > + while(@_ && $length < $MAX_ARG_LENGTH) { > + push @args, shift; > + $length += length($args[$#args]); > + } > + push @output, safe_pipe_capture(@$cmd, @args); > + } > + return @output; > +} > + Makes me wonder why you are not spawning xargs by doing it by hand. If the path at the beginning happens to be longer than 1024 then you will run path-less "cvs status"?