Search code examples
gitpathgit-svnhomebrew

How does git decide which version of svn to use in git-svn?


I have installed git and svn with homebrew on my mac running 10.7.4. There is a version of svn on my machine in /usr/bin which appears to be the version that git svn is using.

$ git --version
git version 1.7.10.4

$ svn --version
svn, version 1.7.5 (r1336830)

$ git svn --version
git-svn version 1.7.10.4 (svn 1.6.17)

$ /usr/bin/svn --version
svn, version 1.6.17 (r1128011)

So, can I change the version of svn that git-svn uses? If so, how do I go about it?

Thanks for reading.

--Updated for comment--

$ which git svn
/usr/local/bin/git
/usr/local/bin/svn

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/git/bin

Solution

  • I did a little digging, and it looks like git-svn uses subversion's perl bindings. After a little experimentation, I found that installing an upgraded version of svn with perl enabled fixed the problem. On Mac OSX, this would go something like this:

    # First, I had to take ownership of the perl libs dir,
    # so homebrew could create perl modules
    chown $USER -R /Library/Perl/5.12/darwin-thread-multi-2level
    
    # Then, remove and reinstall Subversion, but add the perl option:
    brew remove svn
    brew install --perl svn
    
    # Lastly, reinstall git (this may be optional, but it may also help.)
    brew remove git
    brew install git
    

    Your problem boils down to the simple fact that your updated Subversion installation didn't include the accompanying perl modules, so git-svn was falling back on the more complete system installation.

    For the record, symlinking /usr/bin/svn to /usr/local/bin/svn did absolutely no good. This has nothing to do with $PATH or anything else, and everything to do with perl modules.