Hi
I'm tryign to migrate from SVN to Bitbucket/Git. I'm running the procedures outlined at http://go-dvcs.atlassian.com/display/aod/Migrating+from+Subversion+to+Git+on+Bitbucket , and it works fine for most of my projects, however one of them isn't working.
I can clone the project initially, but when I then try to clean it (during which it creates local branches for everything), it fails, and leaves the repository unusable.
I think the problem is it tries to import a particular branch, and this causes the issue. I'm not sure whether the branch name is too long or something, but it could be.
From the svn-git-migration.log:
git branch -f -t Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20Web%20Service refs/remotes/Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20We$
refs/remotes/Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20Web%20Service%20when%20get%20a%20365%20days%20duration%20quote%20from%20CTI
Creating the local branch 'Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20Web%20Service%20when%20get%20a%20365%20days%20duration%20quote%20from%20CTI' for Sub$
git branch -f -t Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20Web%20Service%20when%20get%20a%20365%20days%20duration%20quote%20from%20CTI refs/remotes/Webis$
refs/remotes/tags/20121004
refs/remotes/tags/20121018
refs/remotes/trunk
# Checking for obsolete tags...
svn ls https://svn.server.com/svn/project/releases
20121004/
20121018/
git for-each-ref refs/tags/ --format=%(refname)
java.lang.RuntimeException: Nonzero exit code: 128
at scala.sys.process.BasicIO$Streamed$.next$1(BasicIO.scala:32)
at scala.sys.process.BasicIO$Streamed$$anonfun$apply$3.apply(BasicIO.scala:35)
at scala.sys.process.BasicIO$Streamed$.next$1(BasicIO.scala:32)
at scala.sys.process.BasicIO$Streamed$$anonfun$apply$3.apply(BasicIO.scala:35)
at scala.sys.process.BasicIO$Streamed$$anonfun$apply$3.apply(BasicIO.scala:35)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.lines(ProcessBuilderImpl.scala:143)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.lines(ProcessBuilderImpl.scala:106)
at com.atlassian.svn2git.Git.lines(Utils.scala:121)
at com.atlassian.svn2git.Git.forEachRefFull(Utils.scala:87)
at com.atlassian.svn2git.Git.forEachRef(Utils.scala:89)
at com.atlassian.svn2git.Tags$.checkObsolete(Tags.scala:88)
…
And the .git/config is left ending
[branch "Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20Web%20Service"]
remote = .
merge = refs/remotes/Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20Web%20Service
[branch "Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20Web%20Service%20when%20get%20a%20365%20days%20duration%20quote%20from%20CTI"]
remote = .
i.e. without a merge = line for that branch - which then means the whole repository is broken and won't load. If you subsequently try to do any git operation, you get an error line:
fatal: bad config file line 85 in .git/config
85 is the last [branch …] line. I've tried manually adding the merge = to the config file, but it makes no difference.
Does anyone know what this might be?
thanks
Pete
Hi Pete,
So there's actually nothing really "wrong" with that remote property as such. The issue is that git can't parse a branch in the config with a length greater than ~122.
http://git.661346.n2.nabble.com/Super-long-branch-names-corrupt-git-config-td7568542.html
This is made worse by git-svn expanding spaces to %20.
There is definitely another question about whether we should be creating those branch entries in the first place, but one benefit is that we can then accurately perform sync-rebase by looking up the git-svn branch name. I'll try to update our svn migration scripts to either truncate long branches or at least warn/error in these cases with a better message. The former might be hard to do because that would then confuse git-svn on the next fetch.
Charles
I have "solved" this by simply removing the offending line from the .git/config file. I suspect however that were I to re-clean the project, it would fail again for the same reason.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.