Thread (24 messages) 24 messages, 6 authors, 2016-06-15

Re: [PATCH 7/8] Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH

flat view

From: Jeff King <hidden>
Date: 2016-06-15 22:46:55

Possibly related (same subject, not in this thread)

On Fri, Jun 05, 2009 at 06:36:15PM -0500, Brandon Casey wrote:
From: Junio C Hamano <redacted>

Some platforms (like SunOS and family) have kept their common binaries at
some historical moment in time, and introduced new binaries with modern
features in a special location like /usr/xpg4/bin or /usr/ucb.  Some of the
features provided by these modern binaries are expected and required by git.
If the featureful binaries are not in the users path, then git could end up
using the less featureful binary and fail.

So provide a mechanism to prepend elements to the users PATH at runtime so
the modern binaries will be found.
So this bit me already, and it's only been in next for a day. :) I
_already_ have /usr/xpg4/bin in my PATH before /usr/bin, but with this
patch, I get it stuck at the _beginning_ of my PATH automagically. Which
overrides, against my wishes, the "even more sane than /usr/xpg4/bin"
part of my PATH that comes at the beginning.

Specifically, I have "~peff/local/bin" at the beginning of my PATH which
contains a 'vi' that points to vim. Running "git rebase -i" now puts
/usr/xpg4/bin at the beginning of the PATH (before ~peff/local/bin),
which means I end up running the crappy system vi instead. For bonus
fun, "git commit" still runs the correct 'vi' because it doesn't happen
to be implemented as a shell script.

Am I crazy for not having EDITOR=vim instead of EDITOR=vi? Perhaps. But
I wanted to point out that tweaking the PATH behind the user's back does
cause surprises in the real world.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help