3

I started following this post to perform a migration from SVN to GIT.
6 days ago, I executed this:

git svn fetch

And it's still running! I can see the the console log keep changing the revision numbers and I can see the directory keep grow in size. At the moment it's 12GB.

So my SVN repo is big I get that, it also has many branches which not helping. The question is there a way to see what is the current progress in terms of percentage? I simply want to know how many percent of fetching been completed already.

Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
  • 2
    It can even take few weeks !!!! you have huge repository, I once had a customer who migrated 14GB repo and it took him 3 WEEKS!!! :-( – CodeWizard Jan 25 '17 at 22:13
  • 1
    @CodeWizard not helping man! Getting depressed will not help me convinced my team that it will end some day. I need some real estimations – Ilya Gazman Jan 25 '17 at 22:17
  • 1
    Just being honest :-) – CodeWizard Jan 25 '17 at 22:18
  • 1
    Well, progress percentage should roughly be the revision you see in the console divided by the max revision in your SVN repo multiplied by 100. – Vampire Jan 26 '17 at 01:02

2 Answers2

2

git-svn is not the right tool for one-time conversions of repositories or repository parts. It is a great tool if you want to use Git as frontend for an existing SVN server, but for one-time conversions you should not use git-svn, but svn2git which is much more suited for this use-case.

There are plenty of tools called svn2git, the probably best one is the KDE one from https://github.com/svn-all-fast-export/svn2git. I strongly recommend using that svn2git tool. It is the best I know available out there and it is very flexible in what you can do with its rules files.

The nirvdrum svn2git under the hood uses git-svn, so it is not the right tool either. Using the KDE svn2git I personally needed about 2 hours to convert a repository that needed about 1 week with git-svn.

If you are not 100% about the history of your repository, svneverever from http://blog.hartwork.org/?p=763 is a great tool to investigate the history of an SVN repository when migrating it to Git.


Even though git-svn is easier to start with, here are some further reasons why using the KDE svn2git instead of git-svn is superior, besides its flexibility:

  • the history is rebuilt much better and cleaner by svn2git (if the correct one is used), this is especially the case for more complex histories with branches and merges and so on
  • the tags are real tags and not branches in Git
  • with git-svn the tags contain an extra empty commit which also makes them not part of the branches, so a normal fetch will not get them until you give --tags to the command as by default only tags pointing to fetched branches are fetched also. With the proper svn2git tags are where they belong
  • if you changed layout in SVN you can easily configure this with svn2git, with git-svn you will loose history eventually
  • with svn2git you can also split one SVN repository into multiple Git repositories easily
  • or combine multiple SVN repositories in the same SVN root into one Git repository easily
  • the conversion is a gazillion times faster with the correct svn2git than with git-svn

There are many reasons why git-svn is worse and the KDE svn2git is superior. :-)

Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33
Vampire
  • 35,631
  • 4
  • 76
  • 102
  • If svn2git is so much better that git-svn, wouldn't it make sense to send a pull request to the git-svn with a warning on "init" highlighting the pitfalls if the conversion goes beyond simple one-time without hiccups? To prevent the numerous questions under the `git-svn` tag before the problem strikes? – Mykola Gurov Feb 03 '17 at 18:38
  • 2
    It simply is for a totally different use case. git-svn is for using Git as front-end to an existing SVN server to which you want to commit back. If you use a screwdriver to get a nail into a wall, should there be a label on it, saying "don't hit a nail with me"? It works, but you will not get the best result. – Vampire Feb 03 '17 at 20:38
0

Instead of the default git svn use this tool which perform much better and much faster.

https://github.com/nirvdrum/svn2git

I have used it as well and its much better. Here is a post evaluating the process and showing few highlights.

http://blog.smartbear.com/software-quality/migrating-from-subversion-to-git-lessons-learned/

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • Tnx I try it, but back to my original question. Do you think I can some how make any assumptions based on the .git size compared to svn repo size? – Ilya Gazman Jan 25 '17 at 22:41
  • No since each svn commit is converted to git commit and its based upon the number of commits, 100K+ commits can take few days and even more. – CodeWizard Jan 25 '17 at 22:45
  • 1
    Are you sure the nirvdrum `svn2git` is faster? I would really wonder if that's the case. Afair it uses `svn2git` under the hood and makes some additional steps, so it should in fact be even slower than plain `git-svn`, sharing some of its drawbacks. – Vampire Jan 26 '17 at 00:58