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

git clone silently aborts if stdout gets a broken pipe

From
Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Date
Sep 18, 2013, 16:52 UTC
Message-ID
<A612847CFE53224C91B23E3A5B48BAC798CD91DB0B@xmail3.se.axis.com>

One of our Perl scripts that does a git clone suddenly started to fail when I upgraded to git 1.8.4 from 1.8.3.1.

The failing Perl code used a construct like this:
	Git::command_oneline('clone', $url, $path);

There is no error raised, but the directory specified by $path is not created. If I look at the process using strace I can see the clone taking place, but then it seems to get a broken pipe since the code above only cares about the first line from stdout (and with the addition of "Checking connectivity..." git clone now outputs two lines to stdout).

If I change the code to:
	my @foo = Git::command('clone', $url, $path);
it works as expected.

I have attached a simple Perl script that shows the problem. Run it as "clone_test.pl <git url>". With git 1.8.4 it will fail for the first two test cases, whereas with older git versions it succeeds for all four test cases.

I hope this is enough information for someone to look into this regression.

Best regards, //Peter

Next: Jeff King
Message 1 of 11 in “git clone silently aborts if stdout gets a broken pipe”
  1. Peter KjellerstedtSep 18, 2013
  2. Jeff KingSep 18, 2013
  3. Jeff KingSep 18, 2013
  4. Junio C HamanoSep 18, 2013
  5. Jeff KingSep 18, 2013
  6. 1/2 clone: send diagnostic messages to stderrJeff King, Sep 18, 2013
  7. 2/2 clone: treat "checking connectivity" like other progressJeff King, Sep 18, 2013
  8. 3/2 clone: always set transport optionsJeff King, Sep 18, 2013
  9. Peter KjellerstedtSep 19, 2013
  10. Jeff KingSep 19, 2013
  11. Peter KjellerstedtSep 19, 2013

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.