From: Junio C Hamano Date: Wed, 07 Dec 2005 00:39:55 GMT Subject: Re: [RFC] Run hooks with a cleaner environment Message-ID: <7voe3tzqn8.fsf@assigned-by-dhcp.cox.net> In-Reply-To: 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 think doing the "unset GIT_DIR" to be the first thing if you want to access some other repository is documented somewhere but if not please send a patch to document it. As to file descriptors, I think duping the output to original stderr might make sense, but I do not know what breaks, so interested parties may want to test it out and submit a tested patch for inclusion.