git/list[1] front-page[2] threads[3] people[4] search[5] about
 

underscore in Subversion branch name

From
KAKorzynski, Aleksander <aleksander.korzynski@hp.com>
Date
Mar 23, 2011, 12:12 UTC
Message-ID
<4D89E3C7.6060302@hp.com>
Dear Git Support,

I'm cloning a Subversion repository to Git. A bug in Git is triggered by an underscore in the name of one of the Subversion branches.

I use the following command (note: some names are changed):
$ git svn clone https://AAA.FFF.com/svnroot/BBB -s
The process dies with the following error (names changed):
> Found possible branch point: https://AAA.FFF.com/svnroot/BBB/trunk/CCC => https://AAA.FFF.com/svnroot/BBB/branches/DD_EEEEEEE, 100
> fatal: Not a valid object name refs/remotes/DD EEEEEEE
> cat-file commit refs/remotes/DD EEEEEEE: command returned error: 128

Note that in the top line, the name of the branch contains an underscore: "DD_EEEEEE". However, in the middle line, the branch name contains a space: "DD EEEEEE". Apparently, Git at some point translates the underscore in the name of the Subversion branch into a space.

I've had a look at the source code and the process dies inside resolve_local_globs() in the git-svn script. A command at the beginning of that subroutine is:

command(qw#for-each-ref --format=%(refname) refs/#)
When I run the following by hand:
$ git for-each-ref --format='%(refname)' refs
one of the output lines is:
refs/remotes/DD%20EEEEEEE

So it has a sanitised space (%20) at that point already, instead of an underscore.

Git version: 1.7.1

Best regards, Aleksander Korzynski

Message 1 of 1 in “underscore in Subversion branch name”
  1. Korzynski, AleksanderMar 23, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.