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

Re: (resend) [PATCH] Don't ignore write failure from git-diff, git-log, etc.

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 24, 2007, 17:08 UTC
Message-ID
<alpine.LFD.0.98.0706240951440.3593@woody.linux-foundation.org>
In-Reply-To
<7vzm2pwws8.fsf@assigned-by-dhcp.cox.net>
On Sun, 24 Jun 2007, Junio C Hamano wrote:
> 
> I still do not like the fact that this patch makes an error from
> the final stdout flushing override the return value from p->fn()
> even when the function already diagnosed an error
Yeah.

I also don't think it's very _pretty_ code, and it violates my personal coding standards by adding way too deep indentation for the new error cases. It was already three indents deep (reasonably fine, but that NOT_BARE test wass already pretty ugly), but now it becomes five indentation levels deep at its deepest, which is just a sign that things should be split up.

I'd also like to know why it does that fcntl() is done, and I also wonder about that "ferror()" call: it is entirely possible that ferror() is set due to EPIPE, and in that case, it will *not* set errno to EPIPE at all, so it will *still* complain about what I consider an invalid situation.

I dunno. I think the ENOSPC worry is a very real and valid one, but I would really tend prefer something different.

How about this following series of two patches instead, which I'll send as replies to this email..

		Linus
Previous: Junio C HamanoNext: Linus Torvalds
Message 3 of 13 in “(resend) [PATCH] Don't ignore write failure from git-diff, git-log, etc.”
  1. Jim MeyeringJun 23, 2007
  2. Junio C HamanoJun 24, 2007
  3. Linus TorvaldsJun 24, 2007
  4. 1/2 Clean up internal command handlingLinus Torvalds, Jun 24, 2007
  5. 2/2 Check for IO errors after running a commandLinus Torvalds, Jun 24, 2007
  6. Junio C HamanoJun 25, 2007
  7. Johannes SchindelinJun 25, 2007
  8. Johannes SixtJun 25, 2007
  9. Jim MeyeringJun 25, 2007
  10. Linus TorvaldsJun 25, 2007
  11. Matthias LederhoferJun 26, 2007
  12. Jim MeyeringJun 25, 2007
  13. Jim MeyeringJun 24, 2007

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.