Subject: Re: Nesting a submodule inside of another...

From: Andreas Ericsson <[email-masked]>
Date: Wed, 13 Jul 2011 10:43:47 +0200

On 07/12/2011 02:01 PM, John Szakmeister wrote:
> 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                   [email-masked]
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.