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

Re: [PATCH] report which $PATH entry had trouble running execvp(3)

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Apr 20, 2011, 07:37 UTC
Message-ID
<4DAE8D3E.8000705@viscovery.net>
In-Reply-To
<7vaafl371q.fsf_-_@alter.siamese.dyndns.org>
Am 4/20/2011 6:01, schrieb Junio C Hamano:
Show 5 quoted lines
> Add an internal function sane_execvp() that emulates execvp(3), skipping
> ENOENT and EACCES while remembering a path that resulted in EACCES while
> trying later directories on $PATH.  When failing the request at the end,
> report the path that we had trouble with, and use it when reporting the
> error.

I don't think this is worth the trouble. In which way is git different from other tools that execvp other programs?

And how do you help when the script is executable, but the interpreter is not:

$ chmod -x git # use git itself just for exposition $ echo '#!'"$(pwd)/git" > git-frotz $ chmod +x git-frotz $ git --exec-path=. frotz fatal: cannot exec 'git-frotz': Permission denied $ # WTF, git-frotz *is* executable and readable!?!?

IOW, when you get strange behavior, you still have to dig around to know what went wrong.

-- Hannes
Previous: Junio C HamanoNext: Jonathan Nieder
Message 19 of 20 in “[REGRESSION] git-wrapper to run-commands codepath regression”
  1. Junio C HamanoApr 18, 2011
  2. Jeff KingApr 18, 2011
  3. Jeff KingApr 18, 2011
  4. Junio C HamanoApr 18, 2011
  5. Jeff KingApr 18, 2011
  6. Junio C HamanoApr 18, 2011
  7. Andreas SchwabApr 18, 2011
  8. Junio C HamanoApr 18, 2011
  9. Jonathan NiederApr 18, 2011
  10. run-command: write full error message in die_childJonathan Nieder, Apr 19, 2011
  11. Johannes SixtApr 20, 2011
  12. 0/2 Re: run-command: write full error message in die_childJonathan Nieder, Apr 20, 2011
  13. 1/2 tests: check error message from run_commandJonathan Nieder, Apr 20, 2011
  14. 2/2 run-command: handle short writes and EINTR in die_childJonathan Nieder, Apr 20, 2011
  15. Junio C HamanoApr 19, 2011
  16. report which $PATH entry had trouble running execvp(3)Junio C Hamano, Apr 20, 2011
  17. Jeff KingApr 20, 2011
  18. Junio C HamanoApr 21, 2011
  19. Johannes SixtApr 20, 2011
  20. Jonathan NiederApr 20, 2011

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.