git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-cvsexportcommit fails for huge commits

From
Jeff King <peff@peff.net>
Date
Dec 12, 2007, 09:25 UTC
Message-ID
<20071212092512.GB20799@coredump.intra.peff.net>
In-Reply-To
<7vir348e0l.fsf@gitster.siamese.dyndns.org>
On Wed, Dec 12, 2007 at 01:21:14AM -0800, Junio C Hamano wrote:
Show 18 quoted lines
> > +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

Because we are reading the output, and it is possible to get a pipe deadlock. This could be avoided with a tempfile.

> the path at the beginning happens to be longer than 1024 then you will
> run path-less "cvs status"?

No, read the loop again. The length starts at 0, so we always go through the loop body once.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 15 in “git-cvsexportcommit fails for huge commits”
  1. Markus KlinikDec 11, 2007
  2. Jeff KingDec 12, 2007
  3. Junio C HamanoDec 12, 2007
  4. Jeff KingDec 12, 2007
  5. Junio C HamanoDec 14, 2007
  6. Jeff KingDec 14, 2007
  7. Jeff KingDec 14, 2007
  8. Robin RosenbergDec 14, 2007
  9. Jeff KingDec 15, 2007
  10. Linus TorvaldsDec 12, 2007
  11. Jeff KingDec 12, 2007
  12. Martin LanghoffDec 12, 2007
  13. Jeff KingDec 13, 2007
  14. Markus KlinikDec 13, 2007
  15. Jeff KingDec 13, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.