Skip to content

Commit

Permalink
Introduce --no{trunk,branches,tags} switches to fulfil the promises o…
Browse files Browse the repository at this point in the history
…f the README
  • Loading branch information
mss authored and nirvdrum committed Jun 9, 2009
1 parent 3399a80 commit f97ae98
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
23 changes: 9 additions & 14 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -80,30 +80,25 @@ create a git repo from a svn repo in the specified layout.
1. The svn repo is in the standard layout of (trunk, branches, tags) at the
root level of the repo.

$ svn2git http://svn.yoursite.com/path/to/repo --trunk trunk --branches branches --tags tags
$ svn2git http://svn.example.com/path/to/repo

2. The svn repo is NOT in standard layout and has only a trunk and tags at the
root level of the repo.

$ svn2git http://svn.yoursite.com/path/to/repo --trunk trunk --tags tags
$ svn2git http://svn.example.com/path/to/repo --trunk dev --tags rel --nobranches

3. The svn repo is NOT in standard layout and has only a trunk and branches at
the root level of the repo.

$ svn2git http://svn.yoursite.com/path/to/repo --trunk trunk --branches branches

4. The svn repo is NOT in standard layout and has only a trunk at the root
3. The svn repo is NOT in standard layout and has only a trunk at the root
level of the repo.

$ svn2git http://svn.yoursite.com/path/to/repo --trunk trunk
$ svn2git http://svn.example.com/path/to/repo --trunk trunk --nobranches --notags

5. The svn repo is NOT in standard layout and has no trunk, branches, or tags
4. The svn repo is NOT in standard layout and has no trunk, branches, or tags
at the root level of the repo. Instead the root level of the repo is
equivalent to the trunk and there are no tags or branches.

$ svn2git http://svn.yoursite.com/path/to/repo --rootistrunk
$ svn2git http://svn.example.com/path/to/repo --rootistrunk

6. The svn repo is in the standard layout but you want to exclude the massive
5. The svn repo is in the standard layout but you want to exclude the massive
doc directory and the backup files you once accidently added.

$ svn2git http://svn.example.com/path/to/repo --exclude doc --exclude '.*~$'
Expand All @@ -114,8 +109,8 @@ want your new git repo to exist in, change into it and then run one of the
above commands. Note that in the above cases the trunk, branches, tags options
are simply folder names relative to the provided repo path. For example if you
specified trunk=foo branches=bar and tags=foobar it would be referencing
http://svn.yoursite.com/path/to/repo/foo as your trunk, and so on. However, in
case 5 it references the root of the repo as trunk.
http://svn.example.com/path/to/repo/foo as your trunk, and so on. However, in
case 4 it references the root of the repo as trunk.

Authors
-------
Expand Down
24 changes: 19 additions & 5 deletions lib/svn2git/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,31 @@ def parse(args)
opts.on('--branches BRANCHES_PATH', 'Subpath to branches from repository URL (default: branches)') do |branches|
options[:branches] = branches
end

opts.on('--tags TAGS_PATH', 'Subpath to tags from repository URL (default: tags)') do |tags|
options[:tags] = tags
end

opts.on('--authors AUTHORS_FILE', "Path to file containing svn-to-git authors mapping (default: #{DEFAULT_AUTHORS_FILE})") do |authors|
options[:authors] = authors
end

opts.on('--rootistrunk', 'Use this if the root level of the repo is equivalent to the trunk and there are no tags or branches') do
options[:rootistrunk] = true
options[:trunk] = nil
options[:branches] = nil
options[:tags] = nil
end

opts.on('--notrunk', 'Do not import anything from trunk') do
options[:trunk] = nil
end

opts.on('--nobranches', 'Do not try to import any branches') do
options[:branches] = nil
end

opts.on('--notags', 'Do not try to import any tags') do
options[:tags] = nil
end

opts.on('--authors AUTHORS_FILE', "Path to file containing svn-to-git authors mapping (default: #{DEFAULT_AUTHORS_FILE})") do |authors|
options[:authors] = authors
end

opts.on('--exclude REGEX', 'Specify a Perl regular expression to filter paths when fetching; can be used multiple times') do |regex|
Expand Down

0 comments on commit f97ae98

Please sign in to comment.