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

Re: [PATCH] CodingGuidelines: document which output goes to stdout vs. stderr

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Dec 1, 2021, 20:30 UTC
Message-ID
<CAPig+cS3Ymnfeob0UREvpvR0w7uKA7WnVqMn+ZNYOjx35x1p-Q@mail.gmail.com>
In-Reply-To
<YafQMTsU2+vLNalY@coredump.intra.peff.net>
On Wed, Dec 1, 2021 at 2:42 PM Jeff King <peff@peff.net> wrote:
Show 24 quoted lines
> On Wed, Dec 01, 2021 at 12:32:14AM -0500, Eric Sunshine wrote:
> > It has long been practice in this project for a command to emit its
> > primary output to stdout so that it can be captured to a file or sent
> > down a pipe, and to emit "chatty" messages (such as those reporting
> > progress) to stderr so that they don't interfere with the primary
> > output. However, this idiomatic Unix practice is not necessarily
> > universally understood and may be at odds with other schools of thought,
> > such as the somewhat common one that only error messages should go to
> > stderr, and all other messages to stdout. Let's help newcomers by
> > documenting how stdout and stderr are used on this project.
>
> I agree with everything you wrote here and below, which I think captures
> what we want to communicate to folks adding new messages or commands.
>
> I am not quite sure _everyone_ would agree with "this idiomatic Unix
> practice" above. It does seem to be a matter of taste (it is just that
> what you wrote very much agrees with my taste :) ). And "idiomatic Unix
> practice" is probably not to be chatty at all, but I think that has been
> changing over the years.
>
> So I'm not sure if your commit message is being nicely assertive about
> its taste, or is being uncharitable to people who may have different
> tastes (but again, IMHO we should pick a direction and this seems like
> the best one to me). :)

Thanks for the feedback. I'll tone down the commit message when I reroll to make the patch text spell out "Git command" explicitly so that it's less likely to mislead the reader (as it misled Fabian) into thinking the new guideline applies to all output, including test output.

Previous: Jeff KingNext: Philip Oakley
Message 8 of 12 in “CodingGuidelines: document which output goes to stdout vs. stderr”
  1. CodingGuidelines: document which output goes to stdout vs. stderrEric Sunshine, Dec 1, 2021
  2. Fabian StelzerDec 1, 2021
  3. Eric SunshineDec 1, 2021
  4. Fabian StelzerDec 1, 2021
  5. Junio C HamanoDec 1, 2021
  6. Eric SunshineDec 1, 2021
  7. Jeff KingDec 1, 2021
  8. Eric SunshineDec 1, 2021
  9. Philip OakleyDec 1, 2021
  10. Eric SunshineDec 1, 2021
  11. CodingGuidelines: document which output goes to stdout vs. stderrEric Sunshine, Dec 2, 2021
  12. Jeff KingDec 2, 2021

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.