Re: [RFC] Submodules in GIT
From: Andy Parkins <hidden>
Date: 2016-08-11 20:41:48
On Friday 2006, December 01 22:08, Martin Waitz wrote:
quoted
echo $SUBMODULE_HASH > submodule/.git/refs/supermodules/commit$SUPERMODULE_HASHI guess you are aware that you have to scan _all_ trees inside _all_ supermodule commits for possible references.
No you don't; you do it as part of the appropriate normal operations. * supermodule commit - scan the current tree for "link" objects in the tree. If you find one write the reference in the submodule. * adding a new submodule - if this is a new submodule there can't be any references in the supermodule already. * cloning a supermodule, every new commit that gets written in the supermodule gets checked from "link" objects.
So what do you do with deleted submodules? You wouldn't want them to still sit around in your working directory, but you still have to preserve them.
Now that is a tricky one. Mind you, I think that problem exists for any implementation. I haven't got a good answer for that. Andy -- Dr Andrew Parkins, M Eng (Hons), AMIEE