On Sun, 3 Dec 2006, Sven Verdoolaege wrote: > > On Fri, Dec 01, 2006 at 03:30:32PM -0800, Linus Torvalds wrote: > > The only thing that a submodule must NOT be allowed to do on its own is > > pruning (and it's distant cousin "git repack -d"). > > How are you going to enforce this if the submodule isn't supposed > to know that it is being used as a submodule ? Note that there's actually two "submodules": - there's the submodule "project" itself. This one must be totally unaware of the supermodule, because this one might be cloned and copied _independently_ of the supermodule. - there's the PARTICULAR CHECKED-OUT COPY of the submodule that is actually checked out in a supermodule. This is just a specific _instance_ of the particular submodule. So a particular instance of a submodule might be "aware" of the fact that it's a submodule of a supermodule. For example, the "awareness" migth be as simple as just a magic flag file inside it's .git/ directory. And that awareness would be what simply disabled pruning or "repack -d" within that particular instance. But this magic flag doesn't affect the bigger-picture git repository. It's a _private_ flag. So it doesn't affect the git part, any more than it really affects the git repository that you may have a [user] name = Myname email = myemail in your .git/config file. See? You can have private data in a git repository, but that doesn't mean that it's visible as _repository_ data. But it can still affect how git commands act (eg the "user" definitions above will affect the default user information that "git commit" uses, of course, without actually affecting the git archive in any other way) > How is one of the supermodules going to know what references from other > supermodules containing the submodule point into the submodule ? Why would it care? They are other supermodules. It doesn't matter, the same way it doesn't matter that _my_ "git" tree may not have all the same references that _your_ "git" repo has. If I want to get the same references, I'd need to fetch them from you, and at that point, I'd need to get all the objects that are pointed to by those refs too. But only on "git fetch" do you actually start caring. Linus - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html