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

Re: Writing to err vs std

From
JAJay Asbury <vbjay.net@gmail.com>
Date
Mar 9, 2023, 00:15 UTC
Message-ID
<CAH74SFQ9A-hcRfrDs_vE-QhhYTB6V=dbBQQM_0Qdbx88XREwpw@mail.gmail.com>
In-Reply-To
<xmqq7cvqrdu6.fsf@gitster.g>

Thanks for the clarification. Some context. https://github.com/gitextensions/gitextensions/issues/9643 which is a side effect of https://github.com/gitextensions/gitextensions/pull/9562

So I just wanted to get some clarification on when err vs std should be used to eliminate confusion.

On Wed, Mar 8, 2023 at 7:02 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
>
> 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.
>
>
>
-- 
Jay Asbury
PC Repair and custom programs $30/hr 1hr min
My Biking Blog
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 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.