From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH v2 00/21] Support multiple worktrees
Date: Thu, 26 Dec 2013 09:12:43 -0800 [thread overview]
Message-ID: <7vy537k038.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CACsJy8DL5=B=jch6j6g_3xj3KRsLXxwMChVHF9MUFvafhWhYag@mail.gmail.com> (Duy Nguyen's message of "Sun, 22 Dec 2013 15:44:52 +0700")
Duy Nguyen <pclouds@gmail.com> writes:
> On Sun, Dec 22, 2013 at 1:38 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
>> Do we even need to expose them as ref-like things as a part of the
>> external API/UI in the first place? For end-user scripts that want
>> to operate in a real or borrowing worktree, there should be no
>> reason to touch this "other" repository directly. Things like "if
>> one of the wortrees tries to check out a branch that is already
>> checked out elsewhere, error out" policy may need to consult the
>> other worktrees via $GIT_COMMON_DIR mechanism but at that level we
>> have all the control without contaminating end-user facing ref
>> namespace in a way main/FETCH_HEAD... do.
>
> No, external API/UI is just extra bonus. We need to (or should) do so
> in order to handle $GIT_COMMON_DIR/HEAD exactly like how we do normal
> refs.
And that is what I consider a confusion-trigger, not a nice bonus.
I do not think it is particularly a good idea to contaminate
end-user namespace for this kind of "peek another repository"
special operation.
In order to handle your "multiple worktrees manipulating the same
branch" case sanely, you need to be aware of not just the real
repository your worktree is borrowing from, but also _all_ the other
worktrees that borrow from that same real repository, so a single
"main" virtual namespace will not cut it. You will be dealing with
an unbounded set of HEADs, one for each such worktree.
Can't we do this by adding a "with this real repository" layer,
e.g. "resolve HEAD wrt that repository", somewhat similar to how we
peek into submodule namespaces?
next prev parent reply other threads:[~2013-12-26 17:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-19 14:12 [PATCH v2 00/21] Support multiple worktrees Duy Nguyen
2013-12-20 20:32 ` Junio C Hamano
2013-12-21 2:00 ` Duy Nguyen
2013-12-22 6:38 ` Junio C Hamano
2013-12-22 8:44 ` Duy Nguyen
2013-12-26 17:12 ` Junio C Hamano [this message]
2013-12-28 2:46 ` Duy Nguyen
-- strict thread matches above, loose matches on Subject: below --
2013-12-11 14:15 [PATCH/POC 0/7] " Nguyễn Thái Ngọc Duy
2013-12-14 10:54 ` [PATCH v2 00/21] " Nguyễn Thái Ngọc Duy
2013-12-15 2:29 ` Duy Nguyen
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=7vy537k038.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.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 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 NNTP newsgroup(s).