Perils of converting from SVN to Git

KaM Remake was started almost 7 years ago now and at that time I had little knowledge of SVN. No wonder that KMR repository was created flawed. It missed “trunk/branches/tags” folders, which are an industry standard for SVN repositories. We have added them only few years later (in 2011). That did not mattered until now, when we need to migrate from Google Code and that is a good time to switch to Git. Problem is – Git import tools don’t like unusual SVN repositories, like ours.  That means we need to go back in time and fix the KaM Remake repository.

Thanks to simple SVN tools that can dump whole repo in editable text format, restoring SVN structure seems to be working well. I’m splitting the repo into pieces and rearranging them so that now creation of “trunk” folder happens in r1 instead of r1641. That shifts all rev numbers by 1, but luckily I was able to find an early pair of revs I can join into one (r25 and r26). And instead of r1640 that created the trunk I’m inserting a placeholder rev.

Old chain:
r1640 trunk created

New chain
r1 trunk created
r2..r26 known previously as r1..r25, old r26 adjoined with old r25
r27..r1639 as they were
r1640 placeholder rev inserted
r1641.. as they were

That gives us perfectly valid repository meeting required standards. Spent around 1 day on that.

As part of conversion we need a list of all the authors who commit to KMR repository with their emails. We have 15 different authors registered. Finding their emails took another 2,5 hours.

Upcoming perils are due to conversion process. Git cannot work with latest SVN repositories directly. Giving error

Expected FS format ‘2’; found format ‘6’

That is solved by starting local svn server pointing to the SVN repository, so now Git has to work not with a file:///C:/PathToRepo/ path, but a svn://localhost/. 2 days of research trial and error.

Now git cloning is rolling in background, happily processing 1 revision in 2-5 seconds. Which gives us 6740 * 3,5sec ~= 6,5 hours of machine time.

Hope that will work out now 🙂

This entry was posted in Development. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *