Experiments using git subtree to manage FreeBSD contrib/
emaste at freebsd.org
Wed Jan 22 14:33:40 UTC 2020
I have been experimenting with git-subtree to manage contrib/ code, as
a git workflow analogue to our current Subversion vendor branch
approach. As described previously on this list and on the git
mailing list  there were some oddities in our current svn->git
converted repo. They tripped up "git subtree split" and made the
split-out repo unusable.
Recent proposed git patches have addressed those issues and alllow us
to make progress with experiments. (We're not yet ready to commit to
and document the subtree workflow though.)
Tom Clarkson posted a patch set that allows command-line control of
the subtree split process and avoid the undesired part of the commit
graph. I tried the changes, and the patched subtree split works as
I split elftoolchain using these commands:
% git subtee ignore --clear-cache --prefix=contrib/elftoolchain 4d43158
% git subtee use --prefix=contrib/elftoolchain 9ee78763
% git subtee split --prefix=contrib/elftoolchain upstream/master
This took about 15 minutes to run - more than manageable for what will
be a one-time operation.
The result is available in a branch in my github elftoolchain fork.
There are still a few undesired commits (e.g., , ) to be cleaned
up, and a final conversion would be done with additional --ignores to
eliminate them. That said, they don't impede progress while we're
prototyping. The split-out contrib/elftooclhain subtree is a
reasonably faithful representation over 247 commits of the changes
made in svn.
Next steps with subtree experiments include converting additional
contrib/ directories, and prototyping updates from upstream (with some
that use git, and some that do not). I'm interested in finding other
contrib/ code maintainers who are willing to test out the conversion -
please send me a note if so.
More information about the freebsd-git