How to remove absolute path in svn+ssh
As you may or may not know there is a path difference between svn and svn+ssh links in case if subversion server is configured with default root directory:
/etc/sysconfig/svnserve:
This way repository can be checked out using following commands (consider ssh is set up and working):
or
The reason is simple – svn+ssh is just accessing a subversion repository locally, using SSH as the transport, and hence you have access to the entire filesystem. Svnserve daemon, in contrast, is told “start your paths with /path-to-repos”, and so you don’t have to specify it manually. You can’t argue with me that this can be really annoying in case if, for example, you work with repositories from your local intranet over svn, and from outside world over ssh.
Solution is simple. Wrapper script in place of original svnserve binary:
Rename svnserve to, let’s say, svnserve.bin:
Save this script as /usr/bin/svnserve:
exec /usr/bin/svnserve.bin -r /path-to-repos "$@"
Update permissions:
Voila! Now your repository links will look similar for both svn and svn+ssh: