@@ -36,6 +36,7 @@ def parse(args)
3636 # Set up reasonable defaults for options.
3737 options = { }
3838 options [ :verbose ] = false
39+ options [ :metadata ] = false
3940 options [ :rootistrunk ] = false
4041 options [ :trunk ] = 'trunk'
4142 options [ :branches ] = 'branches'
@@ -88,6 +89,10 @@ def parse(args)
8889 options [ :tags ] = nil
8990 end
9091
92+ opts . on ( '-m' , '--metadata' , 'Include metadata in git logs (git-svn-id)' ) do
93+ options [ :metadata ] = true
94+ end
95+
9196 opts . on ( '--authors AUTHORS_FILE' , "Path to file containing svn-to-git authors mapping (default: #{ DEFAULT_AUTHORS_FILE } )" ) do |authors |
9297 options [ :authors ] = authors
9398 end
@@ -120,18 +125,23 @@ def clone!
120125 trunk = @options [ :trunk ]
121126 branches = @options [ :branches ]
122127 tags = @options [ :tags ]
128+ metadata = @options [ :metadata ]
123129 rootistrunk = @options [ :rootistrunk ]
124130 authors = @options [ :authors ]
125131 exclude = @options [ :exclude ]
126132
127133 if rootistrunk
128134 # Non-standard repository layout. The repository root is effectively 'trunk.'
129- run_command ( "git svn init --no-metadata --trunk=#{ @url } " )
135+ cmd = "git svn init "
136+ cmd += "--no-metadata " unless metadata
137+ cmd += "--trunk=#{ @url } "
138+ run_command ( cmd )
130139
131140 else
132- cmd = "git svn init --no-metadata "
141+ cmd = "git svn init "
133142
134143 # Add each component to the command that was passed as an argument.
144+ cmd += "--no-metadata " unless metadata
135145 cmd += "--trunk=#{ trunk } " unless trunk . nil?
136146 cmd += "--tags=#{ tags } " unless tags . nil?
137147 cmd += "--branches=#{ branches } " unless branches . nil?
0 commit comments