
Now, I created a master Spirit-3 branch off this that I can publish into, say, Github. The purpose is to allow people to pull from and push into (those whom I give write access to) this.
Wanting to make it modular, I searched around and found git filter-branch. Hence, I was able to create a modular Spirit-3 branch without the other boost libraries. All is well until I did a downstream merge to track the changes that's going into the Boost trunk into my Spirit-3 branch.
boost-trunk (pull)--> spirit3
And hah! It pulls in everything (all boost libraries) again.
So, how do you do what I intend to do? All I want is to have this repo structure:
spirit3 boost/spirit libs/spirit
that can do a merge both ways (upstream and downstream to and from the boost trunk); needless to say, with all the histories intact.
With SVN, it is very easy to extract sub-directories while still tracking changes both ways to and from the source. In Git, everything seems to be one whole global repository. This is one thing I dislike and which SVN has better control over: modularity. Sure, you can make many "modular" git repositories instead of one big one like boost. But the reality is, you don't predict up front how a library is modularized. Spirit itself spawned at least 3 libraries (Phoenix Wave Fusion) that stand on their own now. At one point, in the life of a library, you may want to refactor and decouple parts somewhere else. Doing this in Git is not straightforward at all, unless I am missing something obviously simple (?).
The git-subtree program (at https://github.com/apenwarr/git-subtree, see the git-subtree.txt file for documentation) seems to be designed to address this problem (IIUC, I only used it for a basic case), which is maybe not that straightforward!