git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] store submodule in common dir

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 14, 2018, 23:20 UTC
Message-ID
<xmqqk1osy1qo.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<xmqqo9e4y2gr.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 10 quoted lines
> 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).

Actually I take the last part of that back. When thought naively about, it may appear that it should be doable, but because each of the modules/* directory in the top-level project has to serve as the $GIT_DIR for each submodule checkout, and the desire is to have these three directories to have checkout of three different branches, a single directory under modules/. that is shared among three submodules would *not* work---they must have separate index, HEAD, etc.

Theoretically we should be able to make modules/kernel%2fv2.[24] additional "worktree"s of modules/kernel%2fv2.6, but given that these are all "bare" repositories without an attached working tree, I am not sure how that would supposed to work. Thinking about having multiple worktrees on a single bare repository makes me head spin and ache X-<;-)

Previous: Junio C HamanoNext: Stefan Beller
Message 4 of 11 in “git submodule: 3 modules same git repo?”
  1. Joakim TjernlundAug 14, 2018
  2. 1/2 store submodule in common dirStefan Beller, Aug 14, 2018
  3. Junio C HamanoAug 14, 2018
  4. Junio C HamanoAug 14, 2018
  5. Stefan BellerAug 14, 2018
  6. Jonathan NiederAug 15, 2018
  7. Joakim TjernlundAug 15, 2018
  8. Joakim TjernlundAug 15, 2018
  9. Duy NguyenAug 15, 2018
  10. Stefan BellerAug 14, 2018
  11. Jonathan NiederAug 14, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.