DarkGuardsman
DarkGuardsman

Reputation: 136

Getting merge points in svn for svn to git conversion

I'm currently working on converting SVN repos to git using svn2git. One of the problems I'm running into is that once converted the points at which we merged in svn do not show up in git. Instead we get separated branches and tags with no connections to each other except in rare cases.

To work around this I've been rewriting history manually using git replace and git filter-branch. This is a very slow process that can take hours if not days in some cases. As I have to review the history in git and svn to find the correct locations. Then run replacements on commits to add parents or fix parents in the case of bad merges. I've automated some aspects of this process already using simple scripts that fix things like authors, emails, and dates. However, merges are mostly manual at the moment.

What I would like to do is find a way to automate the process fully. I have an idea of how to manage this with git replace using a list of expected merge locations. Then looping through them to reconnect them using git replace, matching on revision IDs stored in the commit message, and/or using git filter-branch to flow the history. Problem is my understanding of svn is not strong enough to figure out how to export a list of merge points.

Though honestly this doesn't have to be the exact solution as the goal is to preserve merge history to create a proper graph in git. So if there is a way to run svn2git to generate the merges itself that would also be good. As well I have tried sub-git and svn-git with the same results. Sub-git does a better job at handling the tags but both fail at preserving merges.

Upvotes: 0

Views: 66

Answers (0)

Related Questions