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

Re: [RFC] Run hooks with a cleaner environment

From
Junio C Hamano <junkio@cox.net>
Date
Dec 7, 2005, 18:57 UTC
Message-ID
<7voe3srazp.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0512071236260.25300@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
Show 13 quoted lines
> On Tue, 6 Dec 2005, Junio C Hamano wrote:
>
>> Daniel Barkalow <barkalow@iabervon.org> writes:
>> 
>> > GIT_DIR is set to the repository that got the push,
>> 
>> That is done by receive-pack; it chdir()s into the repository
>> and does its thing, and the hooks are called from there; I'd
>> expect cwd to be the repository ('.git'), GIT_DIR to be dot
>> ('.').
>
> I thought I was seeing the full path of the repository as GIT_DIR and I 
> didn't check the cwd.

I do not do this myself, but I was wondering what would happen if somebody has "export GIT_DIR=/var/filfre" in ~/.profile.

Well, I know what would happen, actually --- things would not work when you do fetch/push because the tools want to use the path given from the other end but the environment overrides it with GIT_DIR.

Previous: Daniel Barkalow
Message 5 of 5 in “[RFC] Run hooks with a cleaner environment”
  1. Daniel BarkalowDec 6, 2005
  2. Paul SericeDec 7, 2005
  3. Junio C HamanoDec 7, 2005
  4. Daniel BarkalowDec 7, 2005
  5. Junio C HamanoDec 7, 2005

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.