From: Junio C Hamano Date: Wed, 07 Dec 2005 18:57:30 GMT Subject: Re: [RFC] Run hooks with a cleaner environment Message-ID: <7voe3srazp.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Daniel Barkalow writes: > On Tue, 6 Dec 2005, Junio C Hamano wrote: > >> Daniel Barkalow 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.