Subject: Re: Avery Pennarun's git-subtree?

From: Avery Pennarun <[email-masked]>
Date: Tue, 27 Jul 2010 14:28:41 -0400

On Mon, Jul 26, 2010 at 09:41:42AM -0700, Linus Torvalds wrote:

> On Mon, Jul 26, 2010 at 9:37 AM, Marc Branchaud <[email-masked]> wrote:
> >
> > I think I should mention one aspect of what we're doing, which is that a lot
> > of our submodules are based on external code, and that we occasionally need
> > to modify or customize some of that code.  So it's quite nice for us to
> > maintain private git mirrors of the external repos, with our own private
> > branches that contain our modifications.  Although we want to get much of our
> > changes incorporated into the upstream code bases, upstream release cycles
> > are rarely in sync with ours.
> 
> THIS.
> 
> This is why I always thought that submodules absolutely have to be
> commits, not trees. It's why the git submodule data structures are
> done the way they are. Anything that makes the submodule just a tree
> is fundamentally broken, I think.

I agree completely.  The major failing of git-subtree is that it uses
tree->tree links instead of tree->commit links.

This was necessary only because git fundamentally *mistreats* tree->commit
links: it refuses to push or fetch through them automatically.  That is,
when I fetch a superproject that has a tree->commit link in it, git won't
fetch the subproject's history starting at the targeted commit, even if the
remote repo *has* that history.  And if I make a patch to the subproject,
pushing the superproject won't push that patch.

Have fun,

Avery