Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Error on git-svn: fatal: Not a valid object name refs/remotes/origin/feature with spaces

Fran Vicente May 11, 2023

Hi,

I'm migrating a SVN to Bitbucket following the guide https://www.atlassian.com/git/tutorials/migrating-convert 

My SVN repo had on an early revision a branch with a space on its name, and that caused mergeinfo to contain a reference to that branch. Giving this error:

Checking svn:mergeinfo changes since r7902: 106 sources, 1 changed
fatal: Not a valid object name refs/remotes/origin/feature 11870
cat-file commit refs/remotes/origin/feature 11870: command returned error: 128

I've tried using the --ignore-paths="^Branches/feature\s.*" option, but it does not solve the problem, since the mergeinfo is on another branch.

Any suggestions of how to fix it?

Regards,

Fran

2 answers

0 votes
Fran Vicente June 16, 2023

I have finally decided to use "subgit" and "git-filter-repo", and with those tools I completed a migration without any problem.

The guide https://www.atlassian.com/git/tutorials/migrating-convert is a good overview, but looks outdated, and the tools suggested are not stable.

0 votes
Baskar Annamalai May 16, 2023

Hi @Fran Vicente

I'm assuming this might be related to the encoding issue and Git having an issue identifying the branch name. Could you run the following command and validate that the name of the branch is still relevant to the object name:

git branch -a

Best regards,
Baskar Annamalai 
ServiceRocket.

Fran Vicente May 17, 2023

The branch does exist, but git-svn encodes the space to %20 -> remotes/origin/feature%2011870

The problem is that it only does that when creates the branch, and not during parent resolution based on mergeinfo.

fran@svn2git:~/prs-full.git$ git branch -a
remotes/origin/Active
remotes/origin/Inactive
remotes/origin/LongTerm
remotes/origin/ShortTerm
remotes/origin/ZeroMQ
remotes/origin/feature%2011870
remotes/origin/feature11033
remotes/origin/feature11220
remotes/origin/feature11242
remotes/origin/feature11242@284
remotes/origin/feature11421
...
remotes/origin/trunk

 I have tried other options like --ignore-refs without success.

With --no-follow-parent it continues and finishes, but the repo size seem to duplicate for every branch pushed.

Baskar Annamalai May 28, 2023

The branch on SVN has a space in it, but the branch in git had this space converted to %20 (URL encoded). I don't think git would allow a space character in the branch or would read encoded characters directly. It might be worth fixing this from SVN and then reattempting the migration.

Best regards,
Baskar Annamalai 
ServiceRocket.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events