Re: misleading message printed when worktree add fails
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Nov 28, 2021, 12:37 UTC
- Message-ID
- <CAPig+cQ224Tz5iQ5Yt4fMadehLmrJWGzH7kwUSr+UT4hcQf14w@mail.gmail.com>
- In-Reply-To
- <CA+34VNLj6VB1kCkA=MfM7TZR+6HgqNi5-UaziAoCXacSVkch4A@mail.gmail.com>
Thanks for reporting. Inline comments below...
On Sun, Nov 28, 2021 at 1:53 AM Baruch Burstein <bmburstein@gmail.com> wrote:
Show 15 quoted lines
> What did you do before the bug happened? (Steps to reproduce your issue) > > run `git worktree add <path> <branch>`, where <branch> is an already > checked-out branch > > What happened instead? (Actual behavior) > > worktree was not created, but a confusing message was printed: > "Preparing worktree (checking out '<branch>')" > > What's different between what you expected and what actually happened? > > The printed message seems to indicate that the command was a success, > when in fact > it was not
When I perform these actions, I see a "fatal error" message which clearly indicates failure, not success:
% git worktree add ../foo bar
Preparing worktree (checking out 'bar')
fatal: 'bar' is already checked out at '.../wherever'Is your installation not showing the "fatal error" message?
Or, are you saying that the "Preparing worktree" message is misleading? I read that message as telling me what the command is trying to do (i.e. "Preparing"), and the error happens as it makes the attempts, which seems logical to me, thus I don't see anything misleading in that.
Are you reading it differently, as if it is saying that it already performed that action (i.e. "Prepared")?