nirvdrum / svn2git

Ruby tool for importing existing svn projects into git.
MIT License
2.11k stars 443 forks source link

fatal: refs/remotes/svn/trunk: not a valid SHA1 #300

Open Rhialto opened 3 years ago

Rhialto commented 3 years ago

I am trying to convert the Splix repository https://svn.code.sf.net/p/splix/code/ and I get this:

$ svn2git --verbose --nobranches file:///...I.made.a.mirror.for.speed.../splix/svnmirror/
...
r258 = 73c93d9d2e85d34f6865402c5da399207ab17fc3 (refs/remotes/svn/tags/splix-2.0.0@259) 
        M       ChangeLog
        M       THANKS
        M       rules.mk
r259 = a3dd33a9c671f37b9621e2bd913f0b084fe00716 (refs/remotes/svn/tags/splix-2.0.0@259)
Found branch parent: (refs/remotes/svn/tags/splix-2.0.0) a3dd33a9c671f37b9621e2bd913f0b084fe00716
Following parent with do_switch
Successfully followed parent
r260 = 53da06a13c87f5a880b7b255cd1ed8dc051bcae8 (refs/remotes/svn/tags/splix-2.0.0)
        M       THANKS
        A       ppd/scx4500.ppd
        A       ppd/scx4500fr.ppd
        A       ppd/scx4500pt.ppd
r262 = cdcd43d3ec479ce81bd3b7fef890b905a12ef25e (refs/remotes/svn/tags/splix-2.0.0)
        M       ppd/samsung.drv
        M       ppd/scx4200.ppd
        M       ppd/scx4200fr.ppd
        M       ppd/scx4200pt.ppd
        M       ppd/scx4500.ppd
        M       ppd/scx4500fr.ppd
        M       ppd/scx4500pt.ppd
r263 = 142c9556f9ed9f3aca2d217c3c8f09aafcd517d5 (refs/remotes/svn/tags/splix-2.0.0)
fatal: refs/remotes/svn/trunk: not a valid SHA1
update-ref HEAD refs/remotes/svn/trunk: command returned error: 128

command failed:
git svn fetch

This is a somewhat annoying repo since it doesn't have a trunk directory for the trunk. Also the author apparently switched branches by deleting and copying around files.

svn2git isn't the only command that does weird thing with this repo. git svn clone --tags=tags --ignore-paths=branches file:///.../splix/svnmirror/ gitconversion quietly drops all commits after r263, for example.

MoralCode commented 3 years ago

im not sure how this fixed it for me, but I'm also dealing with a trunkless repo (an old sourceforge repo) and tried creating a new folder and playing with the --revision START_REV parameter to either start at the revision before or a few before the one that is failing and for some reason it worked. Then I was able to start from revision 0 (is that the first revision in svn?) and it finished without issue