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.