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

Nesting a submodule inside of another...

From
John Szakmeister <john@szakmeister.net>
Date
Jul 12, 2011, 12:01 UTC
Message-ID
<CAEBDL5XQDehUyqKoazxy+YVHh_2iAyt9aE-77H1jZg4oujMJgw@mail.gmail.com>
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? Limiting the traversal up the tree, etc.? I've worked around the lack of support to do this for now, but it would be really nice if we could do such a thing.

Thanks!
-John
[1]  I may generate a patch for the error message, as the current
implementation obscures the real error message.  When I try this, git
says:
    The following path is ignored by one of your .gitignore files:
    framework1/module
    Use -f if you really want to add it.
    After some careful debugging, I found out the real error message
was about this sort of nesting being disallowed.
Next: Jens Lehmann
Message 1 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.