Subject: Re: Notes on Using Git with Subprojects

From: Martin Waitz <[email-masked]>
Date: Thu, 28 Sep 2006 09:37:06 +0200

hoi :)

On Wed, Sep 27, 2006 at 09:58:43AM -0700, A Large Angry SCM wrote:
> This means that modules are not separate, stand alone projects but, 
> rather, just a sub part of your bigger project. Very useful and 
> applicable in some situations but other situations want/need separate, 
> stand alone subprojects.

you can do everything with the submodule which would be possible with
a normal GIT repository.  And you can always clone it into an directory
which is not controlled by a parent project.

I really think that this is an very important property of a submodule.

> >By storing the complete refs/heads directory for each submodule instead
> >of only one head, it is possible to track multiple branches of a
> >subproject.  I'm don't know yet how this works out in praktice but I
> >think that it can be nice to be able to atomically commit to several
> >branches of one submodule (perhaps one branch per customer, per
> >hardware platform, whatever).
> 
> It's not immediately clear to me if tracking several long term 
> (globally) visible branches in a checkout sub module is generally useful 
> or only useful in special situations. I need to think about this...

One use-case which may be important here:

The submodule has two different branches which got forked and are not
intended to be merged again.  At some point in time the parent project
wants to switch from one branch of the submodule to another branch.
If a user still has modifications in the old branch and wants to
update the parent project then it is important to know if the local
modifications and those coming from the parent have to be merged or
should stay in different branches.
If the parent is switching branches there should only be some warning
if the user still has modifications in the old branch, giving him the
chance to port the modifications to the other branch.

-- 
Martin Waitz