From: "David Rodríguez" <deivid.rodriguez@gmail.com>
To: Andreas Krey <a.krey@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: git's directory is _prepended_ to PATH when called with an absolute path
Date: Wed, 22 Apr 2015 08:36:00 -0300 [thread overview]
Message-ID: <553787A0.40707@gmail.com> (raw)
In-Reply-To: <20150422054737.GA11889@inner.h.apk.li>
On 22/04/15 02:47, Andreas Krey wrote:
> On Tue, 21 Apr 2015 18:37:29 +0000, David Rodríguez wrote:
> ...
>> This causes issues with Ruby git hooks, because Ruby version managers
>> rely on custom settings in PATH to select the Ruby executable,
> Even if git wouldn't modify PATH this is still a broken way to do that.
> What ruby to execute a hook with is a property of the hook, not of the
> user context invoking it.
>
> Andreas
>
I probably shouldn't have mentioned Ruby version managers since they are
not directly related to this issue. I'll try to elaborate on the issue:
* User is relying on a custom path to select their Ruby version. For
example, let's say the first folder in path is "~/.rubies/2.2.2/bin".
* User runs "/usr/bin/git commit" and a pre-commit hook is triggered.
* The pre-commit hook starts with "#!/us/bin/env ruby" to select the
Ruby to be used in the hook, but since the path has been changed by
"/usr/bin/git", the selected ruby will be "/usr/bin/ruby" and not
"~/.rubies/2.2.2/bin/ruby" as the user would expect.
What's the proper way to do whatever you're saying is done in "a broken
way"?
next prev parent reply other threads:[~2015-04-22 11:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-21 21:37 git's directory is _prepended_ to PATH when called with an absolute path David Rodríguez
2015-04-21 21:48 ` Junio C Hamano
2015-04-21 21:59 ` David Rodríguez
2015-04-21 23:17 ` David Rodríguez
2015-04-22 5:47 ` Andreas Krey
2015-04-22 11:36 ` David Rodríguez [this message]
2015-04-22 15:31 ` Andreas Krey
2015-04-22 17:02 ` brian m. carlson
2015-04-22 17:47 ` David Rodríguez
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=553787A0.40707@gmail.com \
--to=deivid.rodriguez@gmail.com \
--cc=a.krey@gmx.de \
--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).