From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: git@vger.kernel.org
Subject: Re: [RFC] allowing hooks to ignore input?
Date: Mon, 15 Sep 2014 10:51:38 -0700 [thread overview]
Message-ID: <xmqqmwa093h1.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <5413FE06.1020901@kdbg.org> (Johannes Sixt's message of "Sat, 13 Sep 2014 10:19:18 +0200")
Johannes Sixt <j6t@kdbg.org> 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.
next prev parent reply other threads:[~2014-09-15 17:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-12 22:48 [RFC] allowing hooks to ignore input? Junio C Hamano
2014-09-13 8:19 ` Johannes Sixt
2014-09-15 17:51 ` Junio C Hamano [this message]
2014-09-16 22:27 ` Junio C Hamano
2014-09-18 11:14 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqmwa093h1.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.