views:

285

answers:

2

I'm running git 1.7 on Mac OSX, installed via Homebrew. I'm trying to use git svn to work with a Subversion server that requires Subversion 1.5 clients (a restriction enforced via a pre-commit hook.)

Running git svn --version reveals that as far as git is concerned, git svn is equivalent to svn v1.4.4.

I can't establish whether git svn is a total clone of subversion, and thus needs to be updated to meet subversion v1.5 functionality, or if git is compiled against or just points to some version of subversion under the hood.

I've struggled finding anyone else trying to upgrade the version of git-svn, and I'm guessing this client version restriction is unusual, but I'm stuck with it (corporate environment.)

Is it possible to have git operate as svn 1.5?

+3  A: 

You can run svn --version to confirm that versions match, but git svn uses perl svn bindings to actually work with svn, so wherever those are, git svn will pick them up. There isn't an svn install inside git svn.

Conclusion: You would need to update your svn installation to 1.5 to have git svn run as svn 1.5.

MikeSep
Thank you for that clarification. Do you know how the perl svn bindings determine which svn to use?I have the stock, shipping version of Subversion from Mac OSX (10.5), located in `/usr/bin`, and that is v1.4.4; matching the version `git svn` is pointing to. However, I have v1.6.6 installed through Homebrew, located in `/usr/local/bin/`. My path is configured, and `which svn` points to the desired v1.6 `brew` version.Does the underlying perl binding have its own path resolution at runtime, or was it set when git was installed?
Ben Ward
I would start by checking your `LD_LIBRARY_PATH` variable. It's possible that it is missing `/usr/local/lib`, which should be where the svn libraries that match your `/usr/local/bin/svn` are hiding. The `svn` executable itself might have hard-coded that path internally, but `git-svn` won't know where to pick up the libs -- it'll probably fall back to the older libraries in `/usr/lib` that would match `/usr/bin/svn`.
MikeSep
+2  A: 

I'm running git --version 1.6, and when I run git svn --version, I get git-svn version 1.6.5.

apple:mac-zfs alex$ git svn --version
git-svn version 1.6.6 (svn 1.6.5)
apple:.git alex$ git --version
git version 1.6.6
apple:mac-zfs alex$ svn --version
svn, version 1.6.5 (r38866)
   compiled Oct 16 2009, 02:54:10

Is it possible that installing a later version of Git or SVN will help? My guess is the latter.

NB the /usr/bin/svn that I have comes from OSX 10.6.2, looks like in the com.apple.pkg.BSD package. It's possible that an older version of SVN is in 10.5.8; you can download a universal one from http://subversion.apache.org/packages.html#osx

AlBlue
Same here. I have svn 1.4.4 and git-svn reports svn version 1.4.4, too.
ZeissS
Note: Git svn will search the Git path, which is compiled in and not part of the $PATH. So if you have a version elsewhere, I would simply remove the Apple provided one and install yours into /usr/bin, or set up a symlink from /use/bin to /use/local/bin.
AlBlue
Thank you for clarifying about the git path rules, that unwraps a large part of the problem I'm having.
Ben Ward