{"thread":{"id":"59364","subject":"Writing to err vs std","startedAt":"2023-03-08T23:54:21Z","lastAt":"2023-03-09T00:50:10Z","messageCount":4,"participants":["Jay Asbury","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"473241","messageId":"CAH74SFS3hFzYzJ6eb2YenJh4-Pf_VBzVTo8axnEtHDyaJUB-jw@mail.gmail.com","threadId":"59364","inReplyTo":null,"subject":"Writing to err vs std","fromName":"Jay Asbury","fromEmail":"vbjay.net@gmail.com","sentAt":"2023-03-08T23:53:51Z","receivedAt":"2023-03-08T23:54:21Z","isPatch":false,"sender":{"key":"vbjay.net@gmail.com","avatar":null},"body":"I see things like git fetch and other processing writing details to\nstderr and not std.  Can someone point to why this is and what the\nrule is for determining when to write to err vs std?  See\n165f390250874b32ed8158150fe49d574297c9f9 for example.  Is there a\nstandard in the git project that says write this to err while write\nthat to std?  Any guidance and why would be appreciated.\n\nThanks,\nJay Asbury\n"},{"id":"473242","messageId":"xmqq7cvqrdu6.fsf@gitster.g","threadId":"59364","inReplyTo":"CAH74SFS3hFzYzJ6eb2YenJh4-Pf_VBzVTo8axnEtHDyaJUB-jw@mail.gmail.com","subject":"Re: Writing to err vs std","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-03-09T00:02:57Z","receivedAt":"2023-03-09T00:05:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jay Asbury <vbjay.net@gmail.com> writes:\n\n> I see things like git fetch and other processing writing details to\n> stderr and not std.\n\nI assume you meant \"not to standard output\".  \n\nAs a rule of thumb, the core of the output, the information the\nend-user asked for, is sent to the standard output, whether it is\nmachine parseable or otherwise.  And other stuff like progress\nmeter, warning and advice messages, are sent to the standard error.\n\nThis should be documented already in Documentation/CodingGuidelines\nfor our developers.  Do you think it needs to be documented for\nend-users?  I suspect that rather than such \"principle\", they are\nmore interested in seeing what message can be squelched with --quiet\nand what can be piped to downstream with \"git foo |\" on case-by-case\nbasis individually.\n\n\n\n"},{"id":"473243","messageId":"CAH74SFQ9A-hcRfrDs_vE-QhhYTB6V=dbBQQM_0Qdbx88XREwpw@mail.gmail.com","threadId":"59364","inReplyTo":"xmqq7cvqrdu6.fsf@gitster.g","subject":"Re: Writing to err vs std","fromName":"Jay Asbury","fromEmail":"vbjay.net@gmail.com","sentAt":"2023-03-09T00:15:31Z","receivedAt":"2023-03-09T00:16:02Z","isPatch":false,"sender":{"key":"vbjay.net@gmail.com","avatar":null},"body":"Thanks for the clarification. Some context.\nhttps://github.com/gitextensions/gitextensions/issues/9643 which is a\nside effect of https://github.com/gitextensions/gitextensions/pull/9562\n\nSo I just wanted to get some clarification on when err vs std should\nbe used to eliminate confusion.\n\nOn Wed, Mar 8, 2023 at 7:02 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Jay Asbury <vbjay.net@gmail.com> writes:\n>\n> > I see things like git fetch and other processing writing details to\n> > stderr and not std.\n>\n> I assume you meant \"not to standard output\".\n>\n> As a rule of thumb, the core of the output, the information the\n> end-user asked for, is sent to the standard output, whether it is\n> machine parseable or otherwise.  And other stuff like progress\n> meter, warning and advice messages, are sent to the standard error.\n>\n> This should be documented already in Documentation/CodingGuidelines\n> for our developers.  Do you think it needs to be documented for\n> end-users?  I suspect that rather than such \"principle\", they are\n> more interested in seeing what message can be squelched with --quiet\n> and what can be piped to downstream with \"git foo |\" on case-by-case\n> basis individually.\n>\n>\n>\n\n\n-- \nJay Asbury\nPC Repair and custom programs $30/hr 1hr min\nMy Biking Blog\n"},{"id":"473244","messageId":"xmqqttyupx3b.fsf@gitster.g","threadId":"59364","inReplyTo":"CAH74SFQ9A-hcRfrDs_vE-QhhYTB6V=dbBQQM_0Qdbx88XREwpw@mail.gmail.com","subject":"Re: Writing to err vs std","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-03-09T00:50:00Z","receivedAt":"2023-03-09T00:50:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jay Asbury <vbjay.net@gmail.com> writes:\n\n> Thanks for the clarification. Some context.\n> https://github.com/gitextensions/gitextensions/issues/9643 which is a\n> side effect of https://github.com/gitextensions/gitextensions/pull/9562\n>\n> So I just wanted to get some clarification on when err vs std should\n> be used to eliminate confusion.\n\nI thought that the practice to equate an error with any byte shown\nto the standard error died long ago with Tcl ;-)\n\nThanks.\n"}]}