git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: joakim.tjernlund@infinera.com, git@vger.kernel.org,
	bmwill@google.com, pclouds@gmail.com
Subject: Re: [PATCH 1/2] store submodule in common dir
Date: Tue, 14 Aug 2018 16:04:36 -0700	[thread overview]
Message-ID: <xmqqo9e4y2gr.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180814223820.123723-1-sbeller@google.com> (Stefan Beller's message of "Tue, 14 Aug 2018 15:38:20 -0700")

Stefan Beller <sbeller@google.com> writes:

> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  path.c | 1 +
>  1 file changed, 1 insertion(+)
>  
> On Tue, Aug 14, 2018 at 3:27 PM Joakim Tjernlund <Joakim.Tjernlund@infinera.com> wrote:
>>
>> I am trying to create 3 submodules from the same git repo, each pointing to a different branch.
>> Since the repo is somewhat large, I don't want the 3 submodules to clone the same repo 3
>> times, I want one clone and then have the 3 submodules to point to different commits.
>>
>> Is this possible? If not, could it be added?
>
> yup.
>
> According to recent discussions, it would be just this patch.
> (plus some unspecified amount of work, TBD).
>
> I thought about proposing something proper later, but here is the WIP patch.
>
> Thanks,
> Stefan 

My understanding of what Joakim wants to do is to have a top-level
project that has three subdirectories, e.g. kernel/v2.2, kernel/v2.4
and kernel/v2.6, each of which is a submodule that houses these
versions of Linux kernel source, but only clone Linus's repository
(as the up-to-late tree has all the necessary history to check out
these past development tracks).  And that should be doable with
just the main checkout, without any additional worktree (it's just
the matter of having .git/modules/kernel%2fv2.6/ directory pointed
by two symlinks from .git/modules/kernel%2fv2.[24], or something
like that).

Isn't "common_dir" stuff used to decide if each of separate
"worktree" instance (of the superproject) shares ".git/$stuff"
with each other?

Unless I am grossly misinterpreting the original question, I fail to
see how changing .git/modules to be shared across worktrees possibly
affects anything.  I am puzzled...

>
> diff --git a/path.c b/path.c
> index 34f0f98349a..64c9821b834 100644
> --- a/path.c
> +++ b/path.c
> @@ -115,6 +115,7 @@ static struct common_dir common_list[] = {
>  	{ 1, 1, 1, "logs/HEAD" },
>  	{ 0, 1, 1, "logs/refs/bisect" },
>  	{ 0, 1, 0, "lost-found" },
> +	{ 0, 1, 0, "modules" },
>  	{ 0, 1, 0, "objects" },
>  	{ 0, 1, 0, "refs" },
>  	{ 0, 1, 1, "refs/bisect" },

  reply	other threads:[~2018-08-14 23:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14 22:27 git submodule: 3 modules same git repo? Joakim Tjernlund
2018-08-14 22:38 ` [PATCH 1/2] store submodule in common dir Stefan Beller
2018-08-14 23:04   ` Junio C Hamano [this message]
2018-08-14 23:20     ` Junio C Hamano
2018-08-14 23:30       ` Stefan Beller
2018-08-15  0:47       ` Jonathan Nieder
2018-08-15  8:28       ` Joakim Tjernlund
2018-08-15  8:39         ` Joakim Tjernlund
2018-08-15 15:20       ` Duy Nguyen
2018-08-14 23:23     ` Stefan Beller
2018-08-14 23:10 ` git submodule: 3 modules same git repo? Jonathan Nieder

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=xmqqo9e4y2gr.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=joakim.tjernlund@infinera.com \
    --cc=pclouds@gmail.com \
    --cc=sbeller@google.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).