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

git-svn aborts with "Use of uninitialized value $u" when a non-svn-backed branch is present in remote

From
JGJacob Godserv <jacobgodserv@gmail.com>
Date
Sep 22, 2015, 18:48 UTC
Message-ID
<CALi1mtc8zmOzk-qv4XAg6N=ENasnMAENdJSLHK7EcpxRUk1nTw@mail.gmail.com>
I found a specific case in which git-svn improperly aborts:
1. I created a git-svn repository, named "git-svn repo", by cloned an
svn repository via the git-svn tool.
2. I created a normal git repository, named "configuration repo". I
renamed the master branch to "configuration". The initial commit adds
a README and some utility scripts.
3. I created a bare repository, named "master repo".
4. I pushed from the git-svn repo to the master repo.
5. I pushed from the configuration repo to the master repo.

The idea is the configuration branch, which is detached from any git-svn history, can contain some useful tools, defaults, etc., that I can share with teammates who want to use git on this svn project. It's an odd use of git, but it has been working well.

However, a vanilla distribution of Git for Windows 2.5.2 produces the following error when running any git-svn command, such as "git svn info", on the cloned master repo:

Use of uninitialized value $u in substitution (s///) at /mingw64/share/perl5/site_perl/Git/SVN.pm line 105. Use of uninitialized value $u in concatenation (.) or string at /mingw64/share/perl5/site_perl/Git/SVN.pm line 105. refs/remotes/origin/configuration: 'svn+ssh://10.0.1.1/repos/projectA' not found in ''

In the mentioned SVN.pm file, after the line:
                        my $u = (::cmt_metadata("$refname"))[0];
I added the following four lines:
                        if (not defined $u) {
                                warn "W: $refname does not exist in
SVN; skipping";
                                next;
                        }

git-svn appears to operate correctly with this patch. This is my first time ever editing a perl script, so I apologize if I murdered an adorable animal just now.

I'm sending this in so more knowledgeable git-svn developers can comment on this and fix this in the official distribution of git, assuming there is a bug here to fix.

-- 
    Jacob
Next: Jacob Godserv
Message 1 of 6 in “git-svn aborts with "Use of uninitialized value $u" when a non-svn-backed branch is present in remote”
  1. Jacob GodservSep 22, 2015
  2. Jacob GodservJun 24, 2016
  3. Eric WongJun 24, 2016
  4. Eric WongJun 24, 2016
  5. Christian CouderJun 25, 2016
  6. git-svn: warn instead of dying when commit data is missingEric Wong, Jul 2, 2016

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.