lashleigh lashleigh - 1 year ago 84
Git Question

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

I have installed

with homebrew on my mac running 10.7.4. There is a version of
on my machine in
which appears to be the version that
git svn
is using.

$ git --version
git version

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

$ git svn --version
git-svn version (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

$ echo $PATH

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download