Re: [PATCH v2 08/20] remote-curl: accept empty line as terminator
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 20, 2011, 19:41 UTC
- Message-ID
- <7v4o3kcmup.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20110620075541.GA28282@elie>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 17 quoted lines
> Side note: a "done" capability doesn't sound like a bad idea, though, > for another reason. The transport-helper could tell fast-import to > expect a "done" command at the end when importing from a remote helper > declaring it, to catch situations in which the pipe prematurely closes > (for example, because the remote helper has segfaulted). > >> I don't see a convention of terminating on a >> blank line in docs, > > Yes, this would be nice to document. > >> only on EOF. Also I can imagine a blank >> line being read in a case of communication error > > A spurious NL, NL, EOF sequence does not sound likely to me. If the > command stream is passing through a noisy channel, there are worse > corruptions to worry about (e.g., fetching to the wrong ref).
I think everything you said in this message makes sense, especially the part about "premature EOF detection".
The spurious LF is an issue if you are trying to drive the backend by hand for testing, but otherwise probably not.