Re: [RFC] Run hooks with a cleaner environment
- From
Junio C Hamano <junkio@cox.net>
- Date
- Dec 7, 2005, 00:39 UTC
- Message-ID
- <7voe3tzqn8.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.64.0512061716030.25300@iabervon.org>
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 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.