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

Re: Nesting a submodule inside of another...

From
Andreas Ericsson <ae@op5.se>
Date
Jul 13, 2011, 08:43 UTC
Message-ID
<4E1D5AC3.5050409@op5.se>
In-Reply-To
<CAEBDL5XQDehUyqKoazxy+YVHh_2iAyt9aE-77H1jZg4oujMJgw@mail.gmail.com>
On 07/12/2011 02:01 PM, John Szakmeister wrote:
Show 15 quoted lines
> Hi all,
> 
> I've got a project where we have several frameworks involved, and
> external modules we want to pull into the framework tree.  We'd like
> to make use of submodules and have something like this:
>      top-level/<-- .gitmodules lives here
>          src/
>          framework1/<-- a submodule
>              module/<-- another submodule
>          framework2/<-- a submodule
>              module2/<-- another submodule
> 
> Currently, git fails trying to do this.  It's not happy about
> .gitmodules living at the top-level and nesting a submodule inside of
> another[1].  Is there a technical reason that this is not allowed?

Yes. Everything inside a submodule is owned by that submodule, so the master repo can't know anything about it. You can have a submodule which in turn has submodules though. If you couldn't, it wouldn't be possible to checkout only the framework1 repository and get all its dependencies.

I have no idea what problems you run into with more than 2 tiers of submodules though, but I guess that's for you to find out and report about.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
Previous: John Szakmeister
Message 11 of 11 in “Nesting a submodule inside of another...”
  1. John SzakmeisterJul 12, 2011
  2. Jens LehmannJul 12, 2011
  3. John SzakmeisterJul 13, 2011
  4. Jens LehmannJul 13, 2011
  5. Junio C HamanoJul 13, 2011
  6. Jens LehmannJul 13, 2011
  7. Junio C HamanoJul 13, 2011
  8. John SzakmeisterJul 14, 2011
  9. Seth RobertsonJul 14, 2011
  10. John SzakmeisterJul 15, 2011
  11. Andreas EricssonJul 13, 2011

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.