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

Re: "breaking" command output message parsing (was: [RFC PATCH] vreportf: ensure sensible ordering of normal and error output)

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Dec 1, 2021, 14:34 UTC
Message-ID
<CAPig+cQ56HV0fjPkhiWgv3EbRABo2J1-PMxDVmmfjh=t7=6LuA@mail.gmail.com>
In-Reply-To
<211201.86h7bsbf4l.gmgdl@evledraar.gmail.com>
On Wed, Dec 1, 2021 at 8:59 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 24 quoted lines
> On Tue, Nov 30 2021, Eric Sunshine wrote:
> > On Tue, Nov 30, 2021 at 9:05 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
> >> (2) With git-worktree being four or five years old, for
> >> backward-compatibility concerns, I worry that "that ship has sailed",
> >> where 'that' is the freedom to relocate those status-like messages
> >> from stdout to stderr. I don't want to break tooling which exists
> >> around git-worktree.
> >>
> >> I'd be happy to be wrong on the second point -- indeed, git-worktree
> >> is still marked "experimental" in the man-page, but that may not mean
> >> anything this late in the game -- and submit a patch which places
> >> git-worktree's status-like messages on stderr instead of stdout.
> >> Thoughts?
> >
> > If that ship has indeed sailed, then perhaps the best and safest thing
> > to do is admit that git-worktree is an outlier in terms of sending
> > status-like messages to stdout, and just sprinkle the necessary
> > fflush(stdout) around in builtin/worktree.c and live with that
> > localized ugliness. Thoughts?
>
> I really don't think that ship has sailed at all. We're at full liberty
> to change these error messages, and have even done so for some plumbing
> in the past (being sensitive to what sort of messages, sometimes they
> are important).

Just to be clear for other readers, I wasn't talking about changing error messages but rather changing the destination of the "chatty" messages from stdout to stderr. (I think you probably understand that even though you typed "error message" above.)

Show 7 quoted lines
> From some brief skimming of the worktree.c code that doesn't seem to
> apply, i.e. it's just chattyness.
>
> I doubt anyone cares if it's blathering about "preparing a worktree" or
> whatever, it just matters if "git worktree add" and the like fail with
> non-zero, but perhaps there's cases of conflated states, as in that case
> of "git remote" and "git pull".

Peff had already managed to allay my worries about that ship having sailed[1], so that I decided[2] to drop the RFC patch and resubmit as a patch which moves the git-worktree "chatty" messages from stdout to stderr. Nevertheless, it's nice to hear an independent confirmation about that ship.

[1]: https://lore.kernel.org/git/YaaN0pibKWgjcVk3@coredump.intra.peff.net/ [2]: https://lore.kernel.org/git/CAPig+cT+YfgBG3Aqszp+y7iy_megboECZy3NkMqUjBj7=Z661A@mail.gmail.com/

Previous: Ævar Arnfjörð BjarmasonNext: Jeff King
Message 12 of 17 in “vreportf: ensure sensible ordering of normal and error output”
  1. vreportf: ensure sensible ordering of normal and error outputEric Sunshine, Nov 30, 2021
  2. Junio C HamanoNov 30, 2021
  3. Jeff KingNov 30, 2021
  4. Jeff KingNov 30, 2021
  5. Ævar Arnfjörð BjarmasonNov 30, 2021
  6. Jeff KingNov 30, 2021
  7. Eric SunshineNov 30, 2021
  8. Jeff KingNov 30, 2021
  9. Eric SunshineNov 30, 2021
  10. Eric SunshineNov 30, 2021
  11. "breaking" command output message parsing (was: [RFC PATCH] vreportf: ensure sensible ordering of normal and error output)Ævar Arnfjörð Bjarmason, Dec 1, 2021
  12. Eric SunshineDec 1, 2021
  13. Jeff KingNov 30, 2021
  14. Eric SunshineDec 1, 2021
  15. Eric SunshineDec 1, 2021
  16. Ævar Arnfjörð BjarmasonDec 1, 2021
  17. Junio C HamanoDec 2, 2021

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.