git's directory is _prepended_ to PATH when called with an absolute path
- From
David Rodríguez <deivid.rodriguez@gmail.com>
- Date
- Apr 21, 2015, 21:37 UTC
- Message-ID
- <5536C319.4000402@gmail.com>
For example, if I run git using:
$ /usr/bin/git
then /usr/bin is prepended to the path. Is this intentional? If it is, why?
This causes issues with Ruby git hooks, because Ruby version managers rely on custom settings in PATH to select the Ruby executable, and there's usually a system Ruby living in /usr/bin. See https://github.com/github/hub/issues/855 for an example.
Thanks a lot,
David Rodríguez.