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

Re: Writing to err vs std

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 9, 2023, 00:02 UTC
Message-ID
<xmqq7cvqrdu6.fsf@gitster.g>
In-Reply-To
<CAH74SFS3hFzYzJ6eb2YenJh4-Pf_VBzVTo8axnEtHDyaJUB-jw@mail.gmail.com>
Jay Asbury <vbjay.net@gmail.com> writes:
> I see things like git fetch and other processing writing details to
> stderr and not std.
I assume you meant "not to standard output".  

As a rule of thumb, the core of the output, the information the end-user asked for, is sent to the standard output, whether it is machine parseable or otherwise. And other stuff like progress meter, warning and advice messages, are sent to the standard error.

This should be documented already in Documentation/CodingGuidelines for our developers. Do you think it needs to be documented for end-users? I suspect that rather than such "principle", they are more interested in seeing what message can be squelched with --quiet and what can be piped to downstream with "git foo |" on case-by-case basis individually.

Previous: Jay AsburyNext: Jay Asbury
Message 2 of 4 in “Writing to err vs std”
  1. Jay AsburyMar 8, 2023
  2. Junio C HamanoMar 9, 2023
  3. Jay AsburyMar 9, 2023
  4. Junio C HamanoMar 9, 2023

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.