git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] allowing hooks to ignore input?

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 15, 2014, 17:51 UTC
Message-ID
<xmqqmwa093h1.fsf@gitster.dls.corp.google.com>
In-Reply-To
<5413FE06.1020901@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 5 quoted lines
> 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.

Previous: Johannes SixtNext: Junio C Hamano
Message 3 of 5 in “[RFC] allowing hooks to ignore input?”
  1. Junio C HamanoSep 12, 2014
  2. Johannes SixtSep 13, 2014
  3. Junio C HamanoSep 15, 2014
  4. Junio C HamanoSep 16, 2014
  5. Jeff KingSep 18, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.