Subject: Re: [RFC] allowing hooks to ignore input?

From: Junio C Hamano <[email-masked]>
Date: Mon, 15 Sep 2014 10:51:38 -0700

Johannes Sixt <[email-masked]> writes:

> I think this is a good move. Hooks are written by users, who sometimes
> are not clueful enough.
>
> But what do our writers do when they fail with EPIPE? Die? If so, this
> patch alone is not sufficient.

I think it is in a loop

	while (...) {
        	if (write_in_full(...))
                	break;
	}
	...
        return finish_command(&proc);

and the caller only cares about the tatus of finish_command(),
i.e. the exit status of the downstream of the pipe.  In an EPIPE
situation, they have already exited with the status they want to
give to us without listening to what we wanted to tell them, so I
think there is no issue.

We _might_ want to check, at that point of "break", if we got a
write error other than EPIPE and act somewhat differently, but that
would be a different issue the current code already has.  E.g. if we
broke out of the loop due to an EIO or EPERM, it will not be affect
what the later code would do in the current code.