Another svn-git oddity

Ed Maste emaste at
Fri Nov 22 17:39:22 UTC 2019

As mentioned before there are some oddities in our git history - svn
commits translated to git in a slightly strange way. These have been
addressed and if/when we run the conversion from the beginning they'll

I've just found another oddity that affected attempts to use git
subtree for prototyping a method of handling vendor code in our tree.
I'm not sure yet if the changes to the converter would address this
case or not.

The affected commits:
  svn      git                   Headline
r300828 00d578928e Create branch for bhyve graphics import.
r300829 b1cfc58d46 Initial bhyve native graphics support.
r302332 6775e12557 Import bhyve_graphics into CURRENT. Thanks to all who

The actual history from svn:

- r300828 created projects/bhyve_graphics/
(Copied from head/usr.sbin/bhyve, r300827)
- r300829 modified and added files under projects/bhyve_graphics/
- r302332 modified files under head/usr.sbin/bhyve/ and copied other
files from projects/bhyve_graphics/

First, creating the branch. The oddity in svn is that a single
directory was copied to projects/, not the tree as a whole. "git show
00d578928e" renders the change as deleting almost all of the FreeBSD
tree, with a few files copied - e.g.:

deleted file mode 100644
index 94046dd8d368..000000000000
+++ /dev/null
diff --git a/usr.sbin/bhyve/bhyverun.c b/bhyverun.c
similarity index 100%
rename from usr.sbin/bhyve/bhyverun.c
rename to bhyverun.c

(Of course git doesn't actually store the change as diffs.)

Next, some work on the branch. b1cfc58d46 is wholly unremarkable. Some
files were added and others were edited under projects/bhyve_graphics/
in svn. In the git mirror they appear at the top of the tree (i.e.,
bhyverun.c not usr.sbin/bhyverun.c).

Finally merging the branch back to head. 6775e12557 is a merge of two
hashes: 929f609fc0c1 b1cfc58d46a9. There are some Makefile changes,
and some miscellaneous mode changes on newly added files.

This trio of commits confuses "git subtree" because it discovers the
commit that created the bhyve_graphics project branch via one branch
of the merge commit. As a result it decides the initial branch
creation commit affects the subtree, and grafts the entire history
from that point on into the subtree.

This could be addressed either by avoiding the representation of this
as a merge in the svn-git conversion, or possibly as a git-subtree
bugfix. More investigation is needed to determine the appropriate
approach (possibly both).

More information about the freebsd-git mailing list