git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATH modifications for git-hook processes
@ 2015-04-14 16:04 Matthew Rothenberg
  2015-04-14 17:17 ` Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: Matthew Rothenberg @ 2015-04-14 16:04 UTC (permalink / raw)
  To: git

Using git 2.3.5 (on darwin, installed via homebrew), when executing a
script via the commit-msg githook, the following gets *prepended* to
the $PATH for the subprocess:

  /usr/local/Cellar/git/2.3.5/libexec/git-core:/usr/local/Cellar/git/2.3.5/libexec/git-core:/usr/local/bin:{rest
of path...}

I can't find any documentation about this path modification behavior
in the git docs, and I'm not familiar enough with the source code to
locate it there either.

In our case, the prepending of /usr/local/bin is particularly
problematic, as it effectively reorders our chosen PATH hierarchy (in
which user-space versions of commands are picked up prior to system
installed ones).

(It's also curious that the git-core directory gets prepended twice,
but that doesn't cause us any particular issues.)

My questions:
 - what is the expected PATH modification behavior for subprocesses of
git-hooks? Is this documented anywhere?
 - what would be causing /usr/local/bin to be prepended here, and can
it be adjusted via preference?

Thanks!

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

end of thread, other threads:[~2015-04-22 20:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-14 16:04 PATH modifications for git-hook processes Matthew Rothenberg
2015-04-14 17:17 ` Junio C Hamano
2015-04-15 15:00   ` Matthew Rothenberg
2015-04-16  6:17     ` Jeff King
2015-04-16  6:31       ` Jeff King
2015-04-22  0:39       ` David Rodríguez
2015-04-22 17:46       ` Junio C Hamano
2015-04-22 18:14         ` [PATCH] stop putting argv[0] dirname at front of PATH Jeff King
2015-04-22 18:23           ` Eric Sunshine
2015-04-22 18:36             ` Jeff King
2015-04-22 19:23           ` Jonathan Nieder
2015-04-22 20:00             ` Jeff King

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