git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git alias fails if non-accessible directory is in PATH
@ 2011-05-08  9:53 Sebastian Schuberth
  2011-05-08 16:15 ` Michael Schubert
  2011-05-08 16:50 ` Junio C Hamano
  0 siblings, 2 replies; 3+ messages in thread
From: Sebastian Schuberth @ 2011-05-08  9:53 UTC (permalink / raw)
  To: git

Hi,

I just came across the issue at [1] in my Gentoo installation. By default, it is

drwxr-x--- 2 root games 4096 Mar 12 02:22 /usr/games/bin

Moreover, by default users are not in the "games" group and /usr/games/bin is in PATH. For some reason, this makes git fail to run any alias like this

# git config alias.br branch
$ git br
fatal: cannot exec 'git-br': Permission denied

Is this by design, or a bug? I currently do not see a reason for git stop executing an alias just because it cannot access a directory in PATH. Strangely, I also haven't found any discussion about this on the mailing list yet.

The problem is also described at [2] for Mac OS. Reading those posts, this seems to be a regression when coming from 1.6.3 to 1.7.0.

[1] http://www.fractionsofapenny.com/from-the-trenches/gentoo-troubles-with-git-alias
[2] http://stackoverflow.com/questions/4019501/git-alias-problem

-- 
Sebastian Schuberth

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git alias fails if non-accessible directory is in PATH
  2011-05-08  9:53 git alias fails if non-accessible directory is in PATH Sebastian Schuberth
@ 2011-05-08 16:15 ` Michael Schubert
  2011-05-08 16:50 ` Junio C Hamano
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Schubert @ 2011-05-08 16:15 UTC (permalink / raw)
  To: Sebastian Schuberth; +Cc: git


> Is this by design, or a bug? I currently do not see a reason for git stop executing an alias just because it cannot access a directory in PATH. Strangely, I also haven't found any discussion about this on the mailing list yet.

If you look at start_command(), `git br` ends up as execvp call
returning EACCESS in the given case whereas only ENOENT was "expected".
This happens before git tries to resolve the alias.

Could it be a legit assumption that PATH holds only accessible paths?
(POSIX?) Otherwise it's a bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git alias fails if non-accessible directory is in PATH
  2011-05-08  9:53 git alias fails if non-accessible directory is in PATH Sebastian Schuberth
  2011-05-08 16:15 ` Michael Schubert
@ 2011-05-08 16:50 ` Junio C Hamano
  1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2011-05-08 16:50 UTC (permalink / raw)
  To: Sebastian Schuberth; +Cc: git

Sebastian Schuberth <sschuberth@gmail.com> writes:

> # git config alias.br branch
> $ git br
> fatal: cannot exec 'git-br': Permission denied
>
> Is this by design, or a bug?

The "tangent" part of

    http://thread.gmane.org/gmane.comp.version-control.git/171755

and then the discussion that begins at

    http://thread.gmane.org/gmane.comp.version-control.git/171755/focus=171767

may explain the current list concensus.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-08 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-08  9:53 git alias fails if non-accessible directory is in PATH Sebastian Schuberth
2011-05-08 16:15 ` Michael Schubert
2011-05-08 16:50 ` Junio C Hamano

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).