Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Nov 2019 08:52:43 -0500
From:      Ed Maste <emaste@freebsd.org>
To:        freebsd-git@freebsd.org
Subject:   Another svn-git oddity
Message-ID:  <CAPyFy2A8Q=N%2BSS8=wOsfBtZ49QTUVXF2ZRYvUZX2dk=KyhKH-g@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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
disappear.

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.:

diff --git a/COPYRIGHT b/COPYRIGHT
deleted file mode 100644
index 94046dd8d368..000000000000
--- a/COPYRIGHT
+++ /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).



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2A8Q=N%2BSS8=wOsfBtZ49QTUVXF2ZRYvUZX2dk=KyhKH-g>