Subject: Re: [PATCH] start_command: reset disposition of all signals in child

From: Junio C Hamano <[email-masked]>
Date: Mon, 11 Sep 2023 15:20:40 -0700

Phillip Wood <[email-masked]> writes:

> 	Preserve the set of ignored signals so that running git via a
> 	wrapper like nohup works as the user expects

OK.

> The other thing is that we have some instances where we ignore SIGPIPE
> before calling start_command() which means we're ignoring it in the
> child process as well. For example in gpg-interface.c we have
> ...
> rev-list does not check for errors when writing to stdout unless
> GIT_FLUSH is set in the environment so if parent process exits early
> rev-list will keep going until it thinks it has printed everything.

Ahh, yeah, that is bad.  Thanks for pointing them out.

> I think adding a flag to struct child_process to ignore SIGPIPE in the
> parent is probably the best way to avoid problems like this.

OK.  SIGPIPE is special enough that it may deserve to be singled
out.  A pager reading from us quitting does not have to be "we
wanted to write more but got an error" but just "ok, if the user
does not want any more output, that is fine".

THanks.