git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Stefan Beller <sbeller@google.com>
Cc: git <git@vger.kernel.org>,
	"Tomasz Śniatowski" <tsniatowski@vewd.com>,
	"Jonathan Nieder" <jrnieder@gmail.com>,
	"Marc Branchaud" <marcnarc@xiplink.com>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH 01/10] doc: about submodule support with multiple worktrees
Date: Thu, 17 Jan 2019 17:22:12 +0700	[thread overview]
Message-ID: <CACsJy8DV=BF44j8Eu01At1fwD2FH9ANa+7g66xn82du3yhQJKA@mail.gmail.com> (raw)
In-Reply-To: <CAGZ79kYWi0EDr-XvoXm=-Oo-_9FiieNHbWzA5o8TiirLw+xXBg@mail.gmail.com>

On Thu, Jan 17, 2019 at 5:06 AM Stefan Beller <sbeller@google.com> wrote:
> > clones from $GIT_COMMON_DIR/worktrees/X/modules to
> > $GIT_COMMON_DIR/common/modules.
>
> ... from the submodule side of things this is big problem,
> as the submodule is usually assumed at $GIT_DIR/modules/<name>
> (I think we have not been strict in $GIT_DIR $GIT_COMMON_DIR
> in the submodule code)
>
> So the plan is to neither use
>
> $GIT_COMMON_DIR/worktrees/X/modules/Y
> $GIT_COMMON_DIR/modules/Y/worktrees/X
>
> but to create a new third location at
>
> $GIT_COMMON_DIR/common/modules
>
> to which either new submodule worktrees
> or superproject worktrees that happen to have this submodule
> can point to?

Yes. And this is yet another "absorb" operation to move from the
current location to the new one. The code will have to check both
places, just as it has to check if "foo/bar/.git" is a real repo
before it goes to $GIT_DIR/.git/modules/bar (at least this is how I
understand it).

> > The latter directory is shared across all worktrees. Once we keep the
> > clone in a common place, the submodule's worktree can be created and
> > managed with git-worktree[1].
>
> So even when the user has never heard of worktrees, the internal structure
> will be worktree oriented, the common dir in common/modules/Y and in
> $GIT_DIR/modules/Y we could just have a worktree git dir?

I think the .git dir will be in common/modules/Y. $GIT_DIR/modules/Y
is basically replaced by $GIT_COMMON_DIR/common/modules/Y, which
should work even when you don't use git-worktree (in single-worktree
setting, $GIT_COMMON_DIR == $GIT_DIR).
-- 
Duy

  reply	other threads:[~2019-01-17 10:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 10:31 [RFC/PATCH 00/10] Support using submodules with worktrees Nguyễn Thái Ngọc Duy
2019-01-16 10:31 ` [PATCH 01/10] doc: about submodule support with multiple worktrees Nguyễn Thái Ngọc Duy
2019-01-16 22:06   ` Stefan Beller
2019-01-17 10:22     ` Duy Nguyen [this message]
2019-01-16 10:31 ` [PATCH 02/10] submodule--helper: add missing \n Nguyễn Thái Ngọc Duy
2019-01-16 10:31 ` [PATCH 03/10] submodule add: support multiple worktrees Nguyễn Thái Ngọc Duy
2019-01-16 22:27   ` Stefan Beller
2019-01-16 10:31 ` [PATCH 04/10] submodule init: " Nguyễn Thái Ngọc Duy
2019-01-16 10:31 ` [PATCH 05/10] submodule update: add tests for " Nguyễn Thái Ngọc Duy
2019-01-16 10:31 ` [PATCH 06/10] submodule sync: support " Nguyễn Thái Ngọc Duy
2019-01-16 10:31 ` [PATCH 07/10] submodule deinit: " Nguyễn Thái Ngọc Duy
2019-01-16 10:31 ` [PATCH 08/10] submodule clone: use repo_config_set() Nguyễn Thái Ngọc Duy
2019-01-16 10:31 ` [PATCH 09/10] submodule clone: propagate extensions.worktreeConfig Nguyễn Thái Ngọc Duy
2019-01-16 10:31 ` [PATCH 10/10] submodule ensure-core-worktree: write to config.worktree Nguyễn Thái Ngọc Duy

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='CACsJy8DV=BF44j8Eu01At1fwD2FH9ANa+7g66xn82du3yhQJKA@mail.gmail.com' \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=marcnarc@xiplink.com \
    --cc=sbeller@google.com \
    --cc=tsniatowski@vewd.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).