This is the final article in this three-part series on a complex migration of VICE, a software project so old it predates version control and has gone through two VCSes already, from Subversion to Git. Last time we’d interrogated our partially-converted repository, and broken down each branch and tag into a series of source trees and the commits that they came from. Our tasks today are fivefold:
- Take the disjoint commits that are the pre-1.22.9 releases and arrange them into a new branch named
legacy_releases
. - Take the sequences of source trees that we deduced for all the non-release branches and turn them into proper branches in their own right. Attach each branch to trunk at the commit where they were copied out. Unlike the legacy release branch, these branches need to retain authorship, timestamp, and commit comments from the Subversion originals.
- As part of the previous step, any branches that were copied from a subdirectory of
trunk/
instead oftrunk/
itself need to have parent directories fabricated so that they may slot more neatly into the overall structure, work properly withgit diff
and related commands, and so on. - Find the places where we need manual overrides to carry out the previous steps properly, and override as needed. We found one of these last time (release 2.4.2 was miscopied); we expect to find more along the way.
- Clean up the remnants of the conversion; remove any extra material created by the Subversion import and replace branches with tags where appropriate.
The primary theme of this week’s work is editing and fabricating history. We will be creating commits and even new source trees out of source material that the Git repository already knows about but doesn’t think is organized in this way, and we’ll be creating it alongside records that say that all this work was done in the distant past. Nothing about what we are doing today is normal, nor is it part of any sane workflow—but when you’re doing something unusual, sanity is a hindrance.
The Git Book has a page that discusses creating Git objects like blobs, trees, and commits out of whole cloth but while I found it very useful, for what I needed to do here it was not the whole story. The Git Internals tutorial discusses creating material from whole cloth; here we are obliged to coexist with and re-use material that we already have. Usually this makes our lives easier; sometimes it makes it harder. We’ll see both as we go along.
Let’s begin our descent.
Continue reading