tags:

views:

70

answers:

2

i'm inheriting a codebase that has a lot of directories in trunk that really should live in separate repos. all of my development happens in one specific directory, what should be the only thing in trunk.

e.g: /path/to/repo/trunk/true_trunk

all the tags and branches in the repo refer exclusively to this 'true_trunk' directory.

problem is: i can't get git-svn to act like this sub directory of trunk is really trunk. and as a result my checkouts of trunk populate my working directory with the entire contents of trunk, some dozen or so other unrelated code bases.

is there any way to get git-svn to talk only to this 'true_trunk' directoy?

any attempt at specifying this directory yields the following out: Using higher level of URL: svn://path/to/trunk/true_trunk => svn://path/to/repo

+1  A: 

The -T option to git svn init allows you to specify a directory that it will treat as the "trunk" directory. I've used this in the past with oddly arranged Subversion directory trees and it has been successful. You may have to experiment a bit to get the right combination of options for your situation.

Greg Hewgill
A: 

You can specify the your true trunk with the -T option to git svn clone, also -b for your branches and -t for the tags. I think for this layout you may need to specify each branch / tag separately, something like this should work for you,

$ git-svn clone  \
 -T svn://path/to/trunk/true_trunk \
 -b svn://path/to/branches/branch1/true_trunk  \
 -b svn://path/to/branches/branch1/true_trunk \
 -t svn://path/to/tags/tag1/true_trunk \
 -t svn://path/to/tags/tag2/true_trunk \
repository_name

You may need to generate a dump of your branches and tags from svn to help format this command

$ svn ls svn://path/to/tags
$ svn ls svn://path/to/branches
Mike Nelson
Umm, no. The first non-option to `git svn clone` must be the svn repository URI; the `-T/-b/-t` options can be relative, and definitely makes no sense to specify them multiple times (`-b branches` becomes `svn-remote.svn.branches=branches/*:refs/remotes/*` in git's config).
ephemient