All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Turner <dturner@twopensource.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] worktrees: add die_if_shared_symref
Date: Fri, 31 Jul 2015 18:08:45 -0400	[thread overview]
Message-ID: <1438380525.4735.26.camel@twopensource.com> (raw)
In-Reply-To: <CAPig+cRZ4PicP7J0Hdwb1+E9JbE=wsfqEaVX6X4ERST2_nJrxw@mail.gmail.com>

On Fri, 2015-07-31 at 17:36 -0400, Eric Sunshine wrote:
> On Fri, Jul 31, 2015 at 5:15 PM, David Turner <dturner@twopensource.com> wrote:
> > On Fri, 2015-07-31 at 15:35 -0400, Eric Sunshine wrote:
> >> On Fri, Jul 31, 2015 at 3:01 PM, David Turner <dturner@twopensource.com> wrote:
> >> > Add a new function, die_if_shared_symref, which works like
> >> > die_if_checked_out, but for all references.  Refactor
> >> > die_if_checked_out to work in terms of die_if_shared_symref.
> >> >
> >> > Soon, we will use die_if_shared_symref to protect notes merges in
> >> > worktrees.
> >>
> >> I wonder if the diagnostic:
> >>
> >>     'blorp' is already checked out at '/path/name/'
> >>
> >> emitted by check_linked_checkout() needs to be adjusted for this
> >> change. It still makes sense for die_if_checked_out(), but sounds odd
> >> for die_if_shared_symref().
> >
> > How about:
> >
> > 'refs/notes/y' is already referenced from 'NOTES_MERGE_REF' in
> > '/home/dturner/git/t/trash directory.t3320-notes-merge-worktrees/'
> >
> > Does that make sense?
> 
> That might be the best we can do for the generic case of
> die_if_shared_symref(), but I wonder how easily the typical user would
> understand it when trying to checkout a branch already checked out
> elsewhere. One concern is that that message almost comes across as an
> internal Git error (thus inscrutable), whereas:
> 
>     % git checkout blorp
>     'blorp' is already checked out at '/some/path/'
> 
> seems (to me) pretty clearly a user error, thus more easily understood.

Sorry, I meant that for the non-HEAD case.  For the
die_if_already_checked_out case, the original error message would
remain.

But I'll just go ahead and do it the nice way.

      reply	other threads:[~2015-07-31 22:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31 19:01 [PATCH v3 1/2] worktrees: add die_if_shared_symref David Turner
2015-07-31 19:01 ` [PATCH v3 2/2] notes: handle multiple worktrees David Turner
2015-07-31 19:35 ` [PATCH v3 1/2] worktrees: add die_if_shared_symref Eric Sunshine
2015-07-31 20:08   ` Junio C Hamano
2015-07-31 21:15   ` David Turner
2015-07-31 21:36     ` Eric Sunshine
2015-07-31 22:08       ` David Turner [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438380525.4735.26.camel@twopensource.com \
    --to=dturner@twopensource.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.