Re: [RFC] Submodules in GIT
- From
- Sven Verdoolaege <skimo@kotnet.org>
- Date
- Dec 3, 2006, 22:16 UTC
- Message-ID
- <20061203221630.GA940MdfPADPa@greensroom.kotnet.org>
- In-Reply-To
- <Pine.LNX.4.64.0612011510290.3695@woody.osdl.org>
On Fri, Dec 01, 2006 at 04:12:10PM -0800, Linus Torvalds wrote:
Show 20 quoted lines
> So within the supermodule, on a "git object" level, a submodule should > just be named by the SHA1 that was it's HEAD when it was committed within > the supermodule. So in the "tree object", you'd see something like the > following when you go "git ls-tree HEAD" on the superproject: > > ... > 100644 blob 08602f522183dc43787616f37cba9b8af4e3dade xdiff-interface.c > 100644 blob 1346908bea31319aabeabdfd955e2ea9aab37456 xdiff-interface.h > 040000 tree 959dd5d97e665998eb26c764d3a889ae7903d9c2 xdiff > 050000 link 0215ffb08ce99e2bb59eca114a99499a4d06e704 xyzzy > > where that 050000 is the new magic type (I picked one out of my *ss: it's > not a valid type for a file mode, so it's a godo choice, but it could be > anythign that cannot conflict with a real file), which just specifies the > "link" part. The SHA1 is the SHA1 of the commit, and the "xyzzy" is > obviously just the name within the directory of the submodule. > > That's all that is actually required for a lot of git commands that > already expect all objects to be available (ie "git checkout", "git diff" > etc).
But is this object (and all the objects it points to) going to be available (in the superproject) ? The following seems to suggest that you think they shouldn't. How is fsck-objects then going to check that such an object is valid ? Is it going to call fsck-objects recursively on the (available) submodules ?
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 ?
> You must always prune > from the supermodule, because the submodule cannot really know on its own > what references point into it.
How is one of the supermodules going to know what references from other supermodules containing the submodule point into the submodule ?