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

[PATCH 1/2] store submodule in common dir

From
Stefan Beller <sbeller@google.com>
Date
Aug 14, 2018, 22:38 UTC
Message-ID
<20180814223820.123723-1-sbeller@google.com>
In-Reply-To
<95e4f9df528a40bf3f3e648318904500343abf9a.camel@infinera.com>
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:
Show 6 quoted lines
>
> 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

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" },
-- 
2.18.0.865.gffc8e1a3cd6-goog
Previous: Joakim TjernlundNext: Junio C Hamano
Message 2 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.