From: Baruch Burstein <bmburstein@gmail.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: misleading message printed when worktree add fails
Date: Sun, 28 Nov 2021 18:47:14 +0200 [thread overview]
Message-ID: <CA+34VNJbOHYhYgN+p7EsGiRAzf+aAQGeMxCzG1dizFjDRVQVbg@mail.gmail.com> (raw)
In-Reply-To: <CAPig+cQ224Tz5iQ5Yt4fMadehLmrJWGzH7kwUSr+UT4hcQf14w@mail.gmail.com>
I see them in the other order:
fatal: 'master' is already checked out at 'C:/Users/bmbur/temp'
Preparing worktree (checking out 'master')
which I understood as "there was an error, but we managed to recover
somehow and set up the worktree anyway"
On Sun, Nov 28, 2021 at 2:37 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
>
> Thanks for reporting. Inline comments below...
>
> On Sun, Nov 28, 2021 at 1:53 AM Baruch Burstein <bmburstein@gmail.com> wrote:
> > 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")?
next prev parent reply other threads:[~2021-11-28 16:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-28 6:50 misleading message printed when worktree add fails Baruch Burstein
2021-11-28 12:37 ` Eric Sunshine
2021-11-28 16:47 ` Baruch Burstein [this message]
2021-11-28 17:00 ` Eric Sunshine
2021-11-28 17:11 ` rsbecker
2021-11-30 4:46 ` Eric Sunshine
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+34VNJbOHYhYgN+p7EsGiRAzf+aAQGeMxCzG1dizFjDRVQVbg@mail.gmail.com \
--to=bmburstein@gmail.com \
--cc=git@vger.kernel.org \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).