git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Stop prepending /usr/bin to hooks PATH, or document it very clearly

From
Andreas Krey <a.krey@gmx.de>
Date
Oct 18, 2014, 14:49 UTC
Message-ID
<20141018144924.GA17925@inner.h.apk.li>
In-Reply-To
<CAFXrp_c+dxafLOO6T=LDd6OxhfpamkJsUc8iBwB-B41z8Htc4A@mail.gmail.com>

On Fri, 17 Oct 2014 13:25:42 +0000, Ciro Santilli wrote: ...

Show 7 quoted lines
> The problem is that the `/usr/bin` breaks "interpreter version manager
> systems" like RVM, rbenv, virtualenv, etc. since people will write
> hooks like:
> 
>     #!/usr/bin/env ruby
> 
> and the `/usr/bin` ruby will get run instead of the managed one

And that is the right thing to do. What ruby to execute with is a property of the hook script, not of the virtualenv a user happens to be in. If you want virtualenvs, you should set up the right one within the hook script.

...
> - documenting this behavior *very* clearly on `man githooks`
That would still be a good thing to do.
Andreas
-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800
Previous: Ciro SantilliNext: Ciro Santilli
Message 2 of 3 in “Stop prepending /usr/bin to hooks PATH, or document it very clearly”
  1. Ciro SantilliOct 17, 2014
  2. Andreas KreyOct 18, 2014
  3. Ciro SantilliOct 18, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.