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