Search code examples
gitperlsvngit-svn

"git svn" commands fail with "Value is not a string (or undef) at /usr/share/perl5/vendor_perl/Git/SVN/Ra.pm line 96"


I have a git repository created with git svn clone from an upstream SVN repository. The repository was created and configured some time ago (1 or 2 years). Pulling (git svn fetch/git svn rebase) and pushing (git svn dcommit) worked fine before. I stopped using the repository for a couple of months and using any of these commands now fails with:

Value is not a string (or undef) at /usr/share/perl5/vendor_perl/Git/SVN/Ra.pm line 96

So I am not able to use git-svn. How can I make it work again?

I am running Arch Linux so there is a good chance there was an update to either Subversion or Git that somehow broke my setup. However, I didn't find anything related when searching for the error message. The perl line in question looks like this in my current git version (since line 96 might be different in other versions):

SVN::_Core::svn_auth_set_parameter($baton,
    $SVN::_Core::SVN_AUTH_PARAM_DONT_STORE_PASSWORDS,
    bless (\$dont_store_passwords, "_p_void"));

I am currently using subversion 1.9.2 and git 2.6.1

EDIT: The same problem is tracked in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=797705


Solution

  • Git 2.7.1 should soon (February 2016) fix this issue.

    See commit 0b66415 (16 Jan 2016) by Eric Wong (ele828).
    (Merged by Junio C Hamano -- gitster -- in commit 6d579a0, 01 Feb 2016)

    git-svn: fix auth parameter handling on SVN 1.9.0+

    For users with "store-passwords = no" set in the "[auth]" section of their ~/.subversion/config, SVN 1.9.0+ would fail with the following message when attempting to call svn_auth_set_parameter:

    Value is not a string (or undef) at Git/SVN/Ra.pm
    

    Ironically, this breakage was caused by r1553823 in subversion:

    "Make svn_auth_set_parameter() usable from Perl bindings."

    Since 2007 (602015e), git-svn has used a workaround to make svn_auth_set_parameter usable internally.
    However this workaround breaks under SVN 1.9+, which deals properly with the type mapping and fails to recognize our workaround.

    For pre-1.9.0 SVN, we continue to use the existing workaround for the lack of proper type mapping in the bindings.

    Tested under subversion 1.6.17 and 1.9.3.

    I've also verified r1553823 was not backported to SVN 1.8.x:

    BRANCH=http://svn.apache.org/repos/asf/subversion/branches/1.8.x
    svn log -v $BRANCH/subversion/bindings/swig/core.i
    

    ref: https://bugs.debian.org/797705