git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Dale Rowley <ddrowley@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 1/1] run-command.c: ignore bad permissions on dirs in PATH
Date: Tue, 25 May 2010 09:01:49 +0200	[thread overview]
Message-ID: <4BFB75DD.7030201@viscovery.net> (raw)
In-Reply-To: <7vaarownmv.fsf@alter.siamese.dyndns.org>

Am 5/25/2010 7:34, schrieb Junio C Hamano:
> Dale Rowley <ddrowley@gmail.com> writes:
> 
>> 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.
> 
> As long as the issue is "a directory P on PATH is unreadable, and we tried
> to see if P/git-ci is executable and reported failure by exiting", I think
> your patch is a reasonable solution.

But it is not only about an unreadable directory. EACCES is also returned
when a "git command" is found that does not have execute permission:

$ touch ~/bin/git-frob	# ~/bin is in $PATH
$ git frob		# original git
fatal: cannot exec 'git-frob': Permission denied
$ ./git frob		# patched git
WARNING: You called a Git command named 'frob', which does not exist.
Continuing under the assumption that you meant 'ambox'
in 11.0 seconds automatically...

That is, when you write a new git command and forget to set execute
permission, you lose the "Permission denied" error. (Ditto if you
accidentally remove execute permission from an existing external git command.)

The question is which corner case is more important to cater for.

I don't have an idea how to solve both issues short of doing the PATH
lookup manually.

-- Hannes

  reply	other threads:[~2010-05-25  7:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-25  2:55 [PATCH 1/1] run-command.c: ignore bad permissions on dirs in PATH Dale Rowley
2010-05-25  5:34 ` Junio C Hamano
2010-05-25  7:01   ` Johannes Sixt [this message]
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=4BFB75DD.7030201@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=ddrowley@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).