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

[PATCH 0/4] Detect exec errors in start_command early

From
Johannes Sixt <j6t@kdbg.org>
Date
Jan 10, 2010, 13:04 UTC
Message-ID
<201001101404.22258.j6t@kdbg.org>
In-Reply-To
<1263044757-12560-2-git-send-email-ilari.liusvaara@elisanet.fi>
On Samstag, 9. Januar 2010, Ilari Liusvaara wrote:
>  6 files changed, 282 insertions(+), 13 deletions(-)
IMHO, you are going completely overboard with your patch.

You check every single possible and unlikely error condition in the new code that you introde, but ignore that there are quite a number of calls in the existing code whose error conditions go checked.

And as a result, you "only" report errno values of some calls, and ignore that there is at least one potential die() call hidden in execv_git_cmd(). IOW, your code is not a catch-all and only an isolated solution.

I hope I can do better.

I developed this series on top of il/vcs-helper. But patches 1-3/4 are actually an independent topic and also suitable to be merged into jk/run-command-use-shell to implement improved DWIM whether a shell is needed.

Patch 4/4 is to address your problem of weak error reporting with transport helpers. I think I understand now what your problem is -- namely that previously no error was reported if a transport helper program did not exist. The reason for the missing error message is IMO a design weakness in the protocol: It requires that the parent talks first - and by talking to an early-died child process it dies from SIGPIPE. I experimented with signal(SIGPIPE, SIG_IGN) to get around this, but it didn't work (the SIGPIPE arrived anyway).

Anyway, patch 4/4 goes on top of il/vcs-helper after merging the topic consisting of 1-3/4.

Ilari Liusvaara (1):
  Improve error message when a transport helper was not found
Johannes Sixt (3):
  start_command: report child process setup errors to the parent's
    stderr
  run-command: move wait_or_whine earlier
  start_command: detect execvp failures early
 Makefile               |    1 +
 run-command.c          |  177 
+++++++++++++++++++++++++++++++++++-------------
 t/t0061-run-command.sh |   14 ++++
 test-run-command.c     |   35 ++++++++++
 transport-helper.c     |   14 +++-
 5 files changed, 191 insertions(+), 50 deletions(-)
 create mode 100755 t/t0061-run-command.sh
 create mode 100644 test-run-command.c
Previous: Ilari LiusvaaraNext: Johannes Sixt
Message 3 of 11 in “Imporove remote helper exec failure reporting”
  1. 0/2 Imporove remote helper exec failure reportingIlari Liusvaara, Jan 9, 2010
  2. 1/2 Report exec errors from run-commandIlari Liusvaara, Jan 9, 2010
  3. 0/4 Detect exec errors in start_command earlyJohannes Sixt, Jan 10, 2010
  4. 1/4 start_command: report child process setup errors to the parent's stderrJohannes Sixt, Jan 10, 2010
  5. 2/4 run-command: move wait_or_whine earlierJohannes Sixt, Jan 10, 2010
  6. 3/4 start_command: detect execvp failures earlyJohannes Sixt, Jan 10, 2010
  7. Junio C HamanoJan 14, 2010
  8. Johannes SixtJan 14, 2010
  9. Junio C HamanoJan 14, 2010
  10. 4/4 Improve error message when a transport helper was not foundJohannes Sixt, Jan 10, 2010
  11. 2/2 Improve transport helper exec failure reportingIlari Liusvaara, Jan 9, 2010

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.