SVN2Git object reference error
Asked Answered
E

2

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.

Edelmiraedelson answered 4/8, 2016 at 14:51 Comment(0)
M
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.

Mcclellan answered 5/8, 2016 at 8:35 Comment(6)
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)Edelmiraedelson
I've never seen that error. What is the command you are issuing?Mcclellan
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. ;-)Mcclellan
Thanks again @vampireEdelmiraedelson
Sure, still trying because I have to checkout all the SVN repo in my computer!Edelmiraedelson
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.Mcclellan
V
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.

Vraisemblance answered 5/8, 2016 at 18:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.