0

My problem: Migration by an Ubunut VM in Windows; Windows had a blue screen of death; Windows restarted; the migration was damaged!

~/folder$ svn2git --rebase
error: refs/remotes/svn/some_branch does not point to a valid object!
fatal: git cat-file 81974ef70e6b9dba85295bf7341dd6808c03250d: bad file
cat-file commit 81974ef70e6b9dba85295bf7341dd6808c03250d: command returned error: 128

command failed:
git svn fetch

I already tried to fix my problem like mentioned in these answers:

Unfortunately none helped me so far.

Anyone have a clue how to fix that? This migration already took +2 weeks and I don't wanna start again.

Community
  • 1
  • 1
xpto
  • 2,521
  • 4
  • 27
  • 59

2 Answers2

1

There are pleny tools called svn2git, the probably best one is the KDE one from https://github.com/svn-all-fast-export/svn2git. From your question I conclude that you are not using that one, but the one that is based on git-svn. 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.

Also the whole migration that took you more than 2 weeks already will most probably be finished in a few hours as it is blazingly fast.

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.

Vampire
  • 31,050
  • 2
  • 58
  • 88
  • Facing this error: `svn-all-fast-export: /build/subversion-yttRtj/subversion-1.9.3/subversion/libsvn_subr/dirent_uri.c:972: svn_dirent_join: Assertion svn_dirent_is_canonical(base, pool) failed. Aborted (core dumped)` – xpto Aug 05 '16 at 09:53
  • I've never seen that error. What is the command you are issuing? – Vampire Aug 05 '16 at 12:35
  • Well, then you have your solution in the ticket. It was not fixed, but closed due to wrong usage. That's why I asked for your command because I suspected this. ;-) – Vampire Aug 05 '16 at 13:31
  • Thanks again @vampire – xpto Aug 05 '16 at 14:10
  • You're welcome. If the post was helpful you might consider accepting it like described here: http://stackoverflow.com/help/someone-answers :-) – Vampire Aug 05 '16 at 14:51
  • Sure, still trying because I have to checkout all the SVN repo in my computer! – xpto Aug 05 '16 at 14:56
  • Ah, ok, thought it worked already. If you have filesystem access to the SVN machine, you can simply copy the repo files to your local machine or do the conversion on that server directly. – Vampire Aug 05 '16 at 18:23
0

The first problem to solve is to ensure git-fsck runs ok. Thereafter, the second problem is to be able to continue the migration.

It is likely the first commits of the branch were correctly written to disk but the last ones failed. Try to run git reflog show refs/remotes/svn/some_branch. If it shows commits, try to find the last commit that is present: git show <hash>. Then you reset the branch: git update-ref -m 'last commit found' refs/remotes/svn/some_branch <hash>.

Then run git fsck and fix the next branch.

git-svn has a command git svn reset -r <n>. svn2git will probably have a similiar one. This will allow to restart the fetch from the last correct state.

Daniel Fanjul
  • 3,433
  • 3
  • 24
  • 28