threads / discuss / 23663

migrating Mifos from svn to git

Subject: migrating Mifos from svn to git

## tl;dr

3 messages between May 1, 2010 and May 5, 2010.

replies: 2people: 2as markdown or json

Adam Monsen· May 1, 2010, 22:08 UTC · lore

(If you'd like to skip the fluff and get to the point, skip down to the numbered questions.)

I'm a developer on a project called "Mifos". Mifos is FLOSS used by banks who manage loans and savings accounts for the poor.

We're currently using an svn repo hosted at sf.net, and are experiencing pain with Subversion that we feel a great dVCS could alleviate. For instance, our devs (especially those far from sf.net's servers) hate going to the server just to examine logs, branch, and commit. I'm getting us on a dVCS.

I've spent some time with svk and hg, and neither really felt right to me.

git's features are very compelling, and the speed appears unmatched. I like that "git svn" actually reads svn 1.5+ mergeinfo, which we've been relying on heavily in Mifos. I am having some difficulties learning the details of examining history, merging, and rebasing, but I'll figure that stuff out eventually.

The strongest indicator I've had to try git was that everyone I asked for help with dVCS said "what's svk?" and "don't use hg, use git". Git seems to have a huge, successful community.

Questions:
1. Is anyone willing to help me migrate Mifos from svn to git? If so,
please contact me on or off list, or in #mifos or #git on FreeNode IRC
(my nickname is "meonkeys"). It's for a good cause: our vision is to end
world poverty!
2. I'm trying out git-svn (a) to get used to git and (b) to actually try
migrating our svn repo to a git repo. Is there a better way? (cbreak in
#git seemed to think so)
3. When using git-svn, can I first "init"/"git svn fetch" from a local
mirror ( file:///opt/mifos_mirror ), then switch to our real repository
( https://mifos.svn.sourceforge.net/svnroot/mifos ) once I'm mostly up
to date?
4. When using git-svn, "git svn init" works against my local mirror, but
"git svn fetch" dies on svn revision 16072
( http://article.gmane.org/gmane.comp.finance.mifos.scm/6053 ). Can I
maybe just skip that changeset ....nevermind, "git svn fetch
--ignore-paths=branches/removeFinancialActionCache" seemed to do the
trick. Hrm, now I'm stuck at some other commit. Anyway, thanks for
enduring this ramble. Here's the latest problem I'm running into, in
case anyone has ideas on what Fu I might use to get out of this hole:

$ git config svn-remote.svn.url file:///opt/mifos_mirror

$ git svn fetch --ignore-paths=branches/sungard Found merge parent (svn:mergeinfo prop): 6e749fea53b200b609ac12239b6d824a78090f7d Found merge parent (svn:mergeinfo prop): a2fdb47825503de62db74cd349e3feec4c899a88 Found merge parent (svn:mergeinfo prop): 827c31be708522130258cdfd2339cd3d7c94c8df W:svn cherry-pick ignored (/branches/sungard:15786-16227,16237) - missing 3 commit(s) (eg 887a7b93bdec64393230bda45e20e41affde7a4e) fatal: ambiguous argument '6f43cde2a0e277bb7730dfaff3c5c11b67a54009^..ae3b7383b4dc6a15172346623dee3e9c887c8afc': unknown revision or path not in the working tree. Use '--' to separate paths from revisions rev-list 6f43cde2a0e277bb7730dfaff3c5c11b67a54009^..ae3b7383b4dc6a15172346623dee3e9c887c8afc: command returned error: 128

Ulrich Spörlein· May 2, 2010, 08:25 UTC · re: Adam Monsen · lore

Re: migrating Mifos from svn to git

On Sat, 01.05.2010 at 15:08:45 -0700, Adam Monsen wrote:
Show 8 quoted lines
> 1. Is anyone willing to help me migrate Mifos from svn to git? If so,
> please contact me on or off list, or in #mifos or #git on FreeNode IRC
> (my nickname is "meonkeys"). It's for a good cause: our vision is to end
> world poverty!
> 
> 2. I'm trying out git-svn (a) to get used to git and (b) to actually try
> migrating our svn repo to a git repo. Is there a better way? (cbreak in
> #git seemed to think so)

svn2git is faster and can cope with multiple branches better, but it has bugs of its own. Try both of them ...

> 3. When using git-svn, can I first "init"/"git svn fetch" from a local
> mirror ( file:///opt/mifos_mirror ), then switch to our real repository
> ( https://mifos.svn.sourceforge.net/svnroot/mifos ) once I'm mostly up
> to date?

Yes, if both repos have the same UUID this should be possible. You need to fudge this in rev 0 and uuid in your svn mirror.

Show 8 quoted lines
> 4. When using git-svn, "git svn init" works against my local mirror, but
> "git svn fetch" dies on svn revision 16072
> ( http://article.gmane.org/gmane.comp.finance.mifos.scm/6053 ). Can I
> maybe just skip that changeset ....nevermind, "git svn fetch
> --ignore-paths=branches/removeFinancialActionCache" seemed to do the
> trick. Hrm, now I'm stuck at some other commit. Anyway, thanks for
> enduring this ramble. Here's the latest problem I'm running into, in
> case anyone has ideas on what Fu I might use to get out of this hole:

If stuff has been merged from/to those ignored branches, you'll get into trouble later on. So ignoring them altogether doesn't seem like a good plan.

I was only lucky in using git-svn when converting trunk only, or some selected branches where merging is/was done *always* from trunk -> branchXY

hth Uli

Adam Monsen· May 5, 2010, 04:58 UTC · re: Ulrich Spörlein · lore

Re: migrating Mifos from svn to git

Ulrich Spörlein writes:
> svn2git is faster and can cope with multiple branches better, but it has
> bugs of its own. Try both of them ...

I did, and--maybe since svn2git appears to be built atop git-svn--they both break at the same point, spouting an error like:

fatal: ambiguous argument '2f53ad77827c0f1d492c031be4fff20b0d60fffc ^..1a6f5af6bd84cb71f25fb1df1c67de1a9b91ba87': unknown revision or path not in the working tree. Use '--' to separate paths from revisions rev-list 2f53ad77827c0f1d492c031be4fff20b0d60fffc ^..1a6f5af6bd84cb71f25fb1df1c67de1a9b91ba87: command returned error: 128

Anyway, I gave up trying to import all svn 1.5+ mergeinfo. Instead, I'm just pulling in our trunk into one repository, and two release branches into separate repositories. Here's my in-progress experiment so far: http://mifos.git.sourceforge.net/git/gitweb-index.cgi . "head" is what used to be "trunk" in svn.

I started writing up a procedure for our developers here: http://www.mifos.org/developers/wiki/MifosVersionControlGuide

If anyone wants to perfect that wiki page, I would love the help.
> Yes, if both repos have the same UUID this should be possible. You need
> to fudge this in rev 0 and uuid in your svn mirror.
This is helpful. Thank you!

← back to recent threads