From: Jonathan Nieder Date: Mon, 18 Feb 2013 10:12:09 GMT Subject: Re: [PATCHv2 03/10] pkt-line: clean up "gentle" reading function Message-ID: <20130218101209.GC7049@elie.Belkin> In-Reply-To: <20130218091619.GC5096@sigill.intra.peff.net> Jeff King wrote: > Originally we had a single function for reading packetized > data: packet_read_line. Commit 46284dd grew a more "gentle" > form that would return an error instead of dying upon > reading a truncated input stream. However: In other words: Based on the names of two functions "packet_read" and "packet_read_line", it is not obvious which to use and what the ramifications of that choice are. Rename packet_read to packet_read_line_gently and add a comment explaining that the latter is a "gentler" form that returns an error instead of dying upon reading a truncated input stream. While at it: * Rename the internal argument triggering the gentle mode to "gentle" instead of "return_line_fail". * Drop the redundant "return_line_fail &&" in checks like "if (return_line_fail && ret < 0)". safe_read() never returns an error when !gentle. No functional change intended. FWIW, the patch itself is Reviewed-by: Jonathan Nieder