git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Writing to err vs std
@ 2023-03-08 23:53 Jay Asbury
  2023-03-09  0:02 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Jay Asbury @ 2023-03-08 23:53 UTC (permalink / raw)
  To: git

I see things like git fetch and other processing writing details to
stderr and not std.  Can someone point to why this is and what the
rule is for determining when to write to err vs std?  See
165f390250874b32ed8158150fe49d574297c9f9 for example.  Is there a
standard in the git project that says write this to err while write
that to std?  Any guidance and why would be appreciated.

Thanks,
Jay Asbury

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Writing to err vs std
  2023-03-08 23:53 Writing to err vs std Jay Asbury
@ 2023-03-09  0:02 ` Junio C Hamano
  2023-03-09  0:15   ` Jay Asbury
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2023-03-09  0:02 UTC (permalink / raw)
  To: Jay Asbury; +Cc: git

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.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Writing to err vs std
  2023-03-09  0:02 ` Junio C Hamano
@ 2023-03-09  0:15   ` Jay Asbury
  2023-03-09  0:50     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Jay Asbury @ 2023-03-09  0:15 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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:
>
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Writing to err vs std
  2023-03-09  0:15   ` Jay Asbury
@ 2023-03-09  0:50     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2023-03-09  0:50 UTC (permalink / raw)
  To: Jay Asbury; +Cc: git

Jay Asbury <vbjay.net@gmail.com> writes:

> 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.

I thought that the practice to equate an error with any byte shown
to the standard error died long ago with Tcl ;-)

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-09  0:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08 23:53 Writing to err vs std Jay Asbury
2023-03-09  0:02 ` Junio C Hamano
2023-03-09  0:15   ` Jay Asbury
2023-03-09  0:50     ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).