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

Re: [RFC_PATCHv4 4/7] submodule init: redirect stdout to stderr

From
Stefan Beller <sbeller@google.com>
Date
Mar 22, 2016, 16:47 UTC
Message-ID
<CAGZ79kaASKUGs3y9YHUp=QeD=91by4DhJh+tVfj6aNOJSH-3jg@mail.gmail.com>
In-Reply-To
<xmqqd1qmjxrl.fsf@gitster.mtv.corp.google.com>
On Tue, Mar 22, 2016 at 9:14 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Sebastian Schuberth <sschuberth@gmail.com> writes:
My commit message is bad, and I should feel bad. ;)
Quoting from 68b939b2f097b6675 (2013-09-18, clone: send diagnostic
messages to stderr, by Jeff who writes the best commit messages):
    Putting messages like "Cloning into.." and "done" on stdout
    is un-Unix and uselessly clutters the stdout channel. Send
    them to stderr.
    ...
    This should not regress any scripts that try to parse the
    current output, as the output is already internationalized
    and therefore unstable.
Quoting another fbf71645d12d302 (Tue Dec 15 16:04:06 2015,
submodule.c: write "Fetching submodule <foo>" to stderr, by Jonathan)
    The "Pushing submodule <foo>" progress output correctly goes to
    stderr, but "Fetching submodule <foo>" is going to stdout by
    mistake.  Fix it to write to stderr.
>> Just wondering, what's Git's policy on this? This message is neither
>> an error nor a warning, but just purely informational. As such it
>> semantically does not belong to stderr, or?

I think the stance of Git is to write only machine readable stuff to stdout, and essentially all _(translated) stuff (i.e. human readable) goes to stderr as some sort of help or progress indication.

>
Show 10 quoted lines
>
> Some people believe that a clean execution should not give anything
> to stderr (Tcl is one example, IIRC), but I think the core part of
> Git takes the opposite stance (probably unix tradition?).  Anything
> that is not the primary output of the program should go to stdout.
>
> We may not have been very strict in code reviews to enfore it, and
> especially on the fringes of the system it may be easy to find
> violators, though.
>
Previous: Junio C HamanoNext: Sebastian Schuberth
Message 12 of 22 in “[RFC_PATCHv4 0/7] Git submodule labels”
  1. Stefan BellerMar 22, 2016
  2. 1/7 git submodule: teach `add` to label submodulesStefan Beller, Mar 22, 2016
  3. Junio C HamanoMar 22, 2016
  4. Junio C HamanoMar 22, 2016
  5. 2/7 submodule-config: keep labels aroundStefan Beller, Mar 22, 2016
  6. 3/7 submodule-config: add method to check for being labeledStefan Beller, Mar 22, 2016
  7. Junio C HamanoMar 22, 2016
  8. Stefan BellerMar 23, 2016
  9. 4/7 submodule init: redirect stdout to stderrStefan Beller, Mar 22, 2016
  10. Sebastian SchuberthMar 22, 2016
  11. Junio C HamanoMar 22, 2016
  12. Stefan BellerMar 22, 2016
  13. Sebastian SchuberthMar 22, 2016
  14. Junio C HamanoMar 22, 2016
  15. 5/7 submodule update: respect submodule.actionOnLabelStefan Beller, Mar 22, 2016
  16. Junio C HamanoMar 22, 2016
  17. Stefan BellerMar 23, 2016
  18. Junio C HamanoMar 24, 2016
  19. Stefan BellerMar 24, 2016
  20. Junio C HamanoMar 24, 2016
  21. 6/7 clone: allow specification of submodules to be clonedStefan Beller, Mar 22, 2016
  22. 7/7 WIP status/diff: respect submodule.actionOnLabelStefan Beller, Mar 22, 2016

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.