Subject: Re: tracking submodules out of main directory.

From: Jens Lehmann <[email-masked]>
Date: Thu, 28 Jul 2011 18:48:20 +0200

Am 28.07.2011 10:57, schrieb henri GEIST:
> In the current code it was not possible to add a gitlink to a repository
> outside of the main repository.

Me thinks this is a *feature* this patch removes (as I understand it it was
a major design decision that everything /inside/ a directory is controlled
by git).

> This pach :
<snip>
>   - Still forbids to add anything else.

Why? If you let submodules live outside the tree I don't see any reason why
regular files shouldn't live there too (Disclaimer: I d not think that would
be a good idea either ;-).

What you want looks like this:

-+- lib1    #registered as submodule of project1 *and* project2 but not here
 +- project1            # submodule of the superproject
 |  +- ../lib1
 +- project2            # submodule of the superproject
    +- ../lib1

You are opening a can of worms by having two different repos point to the same
submodule living in a third repo (which also happens to be their superproject
and must somehow ignore it). You'll have two SHA1s for a single submodule;
"git submodule foreach --recursive" will have interesting results too; and so
on. Not good.

What about solving that with a "ln -s ../lib1" in "project1" and "project2"
(you seem to need that for your build environment) and adding the submodule
"lib1" to the superproject just like "project1" and "project2"?