git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Run hooks with a cleaner environment
@ 2005-12-06 22:43 Daniel Barkalow
  2005-12-07  0:19 ` Paul Serice
  2005-12-07  0:39 ` Junio C Hamano
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Barkalow @ 2005-12-06 22:43 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

Currently, hooks/post-update is run in the environment that receive-pack 
is run. This means that there are a number of things that are 
unpredictable. I'd like to make it set things up in a more predictable and 
useful way. The things I know are odd:

stdout and stdin are connected to send-pack, either by broken pipes (for 
local pushes) or an ignored socket (via ssh). stdin should probably be 
/dev/null, and stdout should be either a log file or /dev/null. stderr is 
still the push's stderr, which may or may not be desired.

GIT_DIR is set to the repository that got the push, which may surprise 
people who only use it in "GIT_DIR=foo git ..." form and don't expect it 
ever to be set from outside. Of course, it's potentially useful to know 
what repository is running the hook, but that doesn't have to be 
communicated in such a way that git programs will pick it up directly. 
Other environment variables could potentially be purged, too, but I don't 
think that's as important, since the user probably knows about them.

cwd is set to the push's cwd if it's local, maybe $HOME if it's over ssh. 
It should probably always be $HOME, unless we want it to be $GIT_DIR.

Is there anything else we want to regularize? Is there some sort of 
standard behavior we should match, like CVS or cron?

	-Daniel
*This .sig left intentionally blank*

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-12-07 18:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-06 22:43 [RFC] Run hooks with a cleaner environment Daniel Barkalow
2005-12-07  0:19 ` Paul Serice
2005-12-07  0:39 ` Junio C Hamano
2005-12-07 17:47   ` Daniel Barkalow
2005-12-07 18:57     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).