public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Eric Sunshine <sunshine@sunshineco•com>
Cc: David Turner <dturner@twopensource•com>, Git List <git@vger•kernel.org>
Subject: Re: [PATCH v3 1/2] worktrees: add die_if_shared_symref
Date: Fri, 31 Jul 2015 13:08:09 -0700	[thread overview]
Message-ID: <xmqqr3no3xau.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAPig+cTX0Wav2QSFi734uLVpjdmwFKzcesgkpmVKCPomMB_HyA@mail.gmail.com> (Eric Sunshine's message of "Fri, 31 Jul 2015 15:35:18 -0400")

Eric Sunshine <sunshine@sunshineco•com> writes:

> 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().

True.  Lift the dying one callstack up, and make the lower level
helper check_shared_symref() or something that returns NULL (ok) or
that '/path/name' upon an error?

Also I suspect that this comment will become hard to grok after the
commit is actually made:

>  	/*
> -	 * $GIT_COMMON_DIR/HEAD is practically outside
> +	 * $GIT_COMMON_DIR/$symref is practically outside
>  	 * $GIT_DIR so resolve_ref_unsafe() won't work (it
>  	 * uses git_path). Parse the ref ourselves.
>  	 */

A reviewer who is viewing both the pre- and post- text of the patch
can see it used to say HEAD and now it is extended to $symref, but
it would help to have "(e.g. HEAD)" after "...DIR/$symref", I think.

  reply	other threads:[~2015-07-31 20: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 [this message]
2015-07-31 21:15   ` David Turner
2015-07-31 21:36     ` Eric Sunshine
2015-07-31 22:08       ` David Turner

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=xmqqr3no3xau.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=dturner@twopensource$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=sunshine@sunshineco$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox