substack/pushover — pull request #8 by isaacs (2012-05-27 19:34:29+00:00)
Title: Respond to 'close' event rather than 'exit' on newer nodes

In node 0.6 and before, the semantics around the child process 'exit' even were a bit screwey. Even after the child process had actually exited, it would delay until the stdout and stderr had closed before emitting the exit event.

This was especially problematic when sharing FDs with the parent process, since the stdout and stderr would *never* close, and there was no way to know when the child was done with them.

For 0.8 and above, we've changed this. Now, 'exit' means 'the child process has exited' and the 'close' event means 'the output is done'. For pushover, this means that we need to listen for the `close` event, since that is when all the output from git is actually done.