Re: [PATCH v2 0/7] read/write_in_full leftovers
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 27, 2017, 06:57 UTC
- Message-ID
- <xmqqy3p04oi2.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170927055424.22ati3g24xaqtqrk@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> I dropped the "read_in_full() should set errno on short reads" idea (3/7 > in the earlier series). It really is the caller's fault for looking at > errno when they know there hasn't been an error in the first place. We > should just bite the bullet and have the callers do the right thing. > > I also dropped the "xread_in_full" helper (7/7 earlier). The lego > sentences it created just weren't worth the hassle. Instead, I've fixed > all of the relevant callers to provide good error messages for both > cases. It's a few more lines of code, and it's probably rare for users > to see these in the first place. But it doesn't hurt too much to be > thorough, and I think it's good to model correct error handling. This is > in patches 4 and 5 below.
Thanks for being thorough. My comment on 3/7 might be taken as contradicting with how 5/7 ties the loose ends up, but I do not care too deeply either way.
Will queue.