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

From: Johannes Sixt <[email-masked]>
Date: Wed, 20 Apr 2011 09:37:34 +0200

Am 4/20/2011 6:01, schrieb Junio C Hamano:
> 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