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

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

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
May 26, 2007, 16:18 UTC
Message-ID
<alpine.LFD.0.98.0705260910220.26602@woody.linux-foundation.org>
In-Reply-To
<87bqg724gp.fsf@rho.meyering.net>
On Sat, 26 May 2007, Jim Meyering wrote:
Show 5 quoted lines
>
> Each git command should report such a failure.
> Some already do, but with the patch below, they all do, and we
> won't have to rely on code in each command's implementation to
> perform the right incantation.
The patch is wrong.
Some write errors are expected and GOOD.

For example, EPIPE should not be reported. It's normal. The user got bored. It might be hidden by the SIGPIPE killing us, but regardless, reporting it for the normal log/diff thing is just not correct. EPIPE isn't an error, it's a "ok, nobody is listening any more".

Also, PLEASE don't do this:
> +		if (0 <= fcntl(fileno (stdout), F_GETFD)
That's totally unreadable to any normal human.

You don't say "if zero is smaller or equal to X". You say "if X is larger than or equal to zero". Stop messing with peoples minds, dammit!

Anybody who thinks that code like this causes fewer errors is just fooling himself. It causes *more* bugs, because people have a harder time reading it.

Maybe you and Junio have taught yourself bad manners, but you're a tiny tiny part of humanity or the development community. Junio can do it just because while he's just a single person, he's a big part of the git coding base, but anybody else who does it should just be shot.

			Linus
Previous: Jim MeyeringNext: Junio C Hamano
Message 2 of 29 in “Don't ignore write failure from git-diff, git-log, etc.”
  1. Don't ignore write failure from git-diff, git-log, etc.Jim Meyering, May 26, 2007
  2. Linus TorvaldsMay 26, 2007
  3. Junio C HamanoMay 26, 2007
  4. Nicolas PitreMay 27, 2007
  5. Jim MeyeringMay 27, 2007
  6. Linus TorvaldsMay 27, 2007
  7. Jim MeyeringMay 28, 2007
  8. Marco RoelandMay 28, 2007
  9. Jim MeyeringMay 28, 2007
  10. Marco RoelandMay 28, 2007
  11. Jim MeyeringMay 28, 2007
  12. Petr BaudisMay 28, 2007
  13. Junio C HamanoMay 28, 2007
  14. Jim MeyeringMay 29, 2007
  15. Junio C HamanoMay 29, 2007
  16. Jim MeyeringMay 30, 2007
  17. Linus TorvaldsMay 28, 2007
  18. Jim MeyeringMay 28, 2007
  19. Linus TorvaldsMay 29, 2007
  20. Jim MeyeringMay 29, 2007
  21. Linus TorvaldsMay 29, 2007
  22. Jim MeyeringMay 30, 2007
  23. Linus TorvaldsMay 30, 2007
  24. Jim MeyeringMay 30, 2007
  25. Junio C HamanoMay 28, 2007
  26. Linus TorvaldsMay 29, 2007
  27. Jim MeyeringMay 30, 2007
  28. Junio C HamanoMay 30, 2007
  29. Jim MeyeringMay 30, 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.