git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dale Rowley <ddrowley@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH 1/1] run-command.c: ignore bad permissions on dirs in PATH
Date: Mon, 24 May 2010 20:55:06 -0600	[thread overview]
Message-ID: <4BFB3C0A.2030505@gmail.com> (raw)

All of my git aliases stopped working one day. For example, when I ran 'git ci'
(where 'ci' is an alias for 'commit') it printed out this error:

fatal: cannot exec 'git-ci': Permission denied

This error was confusing (I didn't have a 'git-ci' executable anywhere, so why
was it complaining about permissions?) and it took me a while to figure out that
this was happening because I happened to have a random directory in my PATH that
had permissions set incorrectly. Git should probably ignore this, and here is
one way to fix it, although I'm not sure if it's the best way.



Signed-off-by: Dale Rowley <ddrowley@gmail.com>
---
 run-command.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/run-command.c b/run-command.c
index c7793f5..a98282b 100644
--- a/run-command.c
+++ b/run-command.c
@@ -284,7 +284,7 @@ fail_pipe:
 		 * Do not check for cmd->silent_exec_failure; the parent
 		 * process will check it when it sees this exit code.
 		 */
-		if (errno == ENOENT)
+		if (errno == ENOENT || errno == EACCES)
 			exit(127);
 		else
 			die_errno("cannot exec '%s'", cmd->argv[0]);
-- 
1.7.1.226.g770c5.dirty

             reply	other threads:[~2010-05-25  2:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-25  2:55 Dale Rowley [this message]
2010-05-25  5:34 ` [PATCH 1/1] run-command.c: ignore bad permissions on dirs in PATH Junio C Hamano
2010-05-25  7:01   ` Johannes Sixt
2010-05-26  2:36     ` Dale Rowley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BFB3C0A.2030505@gmail.com \
    --to=ddrowley@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).