Re: misleading message printed when worktree add fails
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Nov 30, 2021, 04:46 UTC
- Message-ID
- <CAPig+cSRonrX2SUARS=spEnWzapH6osvi3ZvZ2rPURA2zRSkvQ@mail.gmail.com>
- In-Reply-To
- <CAPig+cTGq-10ZTBts2LXRVdPMf2vNMX8HTuhg_+ZHSiLX-brOQ@mail.gmail.com>
On Sun, Nov 28, 2021 at 12:00 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 10 quoted lines
> Okay, that's happening because the "Preparing" message is sent to > stdout, whereas the "fatal" error is sent to stderr, and the streams > are being flushed on Windows in a different order than what we > typically see on Unix platforms even though the "Preparing" message is > actually output first by the code. > > A general fix (not specific to git-worktree) might be to have die() > (or maybe vreportf()?) flush stdout before reporting the error message > on stderr. That should make output order more predictable, such that > general status messages appear before error messages.
An RFC patch has been posted to address this issue. https://lore.kernel.org/git/20211130043946.19987-1-sunshine@sunshineco.com/