@@ -53,6 +53,7 @@ def parse(args)
53
53
options [ :revision ] = nil
54
54
options [ :username ] = nil
55
55
options [ :rebasebranch ] = false
56
+ options [ :localtime ] = nil
56
57
57
58
if File . exists? ( File . expand_path ( DEFAULT_AUTHORS_FILE ) )
58
59
options [ :authors ] = DEFAULT_AUTHORS_FILE
@@ -125,6 +126,10 @@ def parse(args)
125
126
options [ :exclude ] << regex
126
127
end
127
128
129
+ opts . on ( '--localtime' , 'Use localtime for git commit history timestamps (default is GMT)' ) do
130
+ options [ :localtime ] = true
131
+ end
132
+
128
133
opts . on ( '-v' , '--verbose' , 'Be verbose in logging -- useful for debugging issues' ) do
129
134
options [ :verbose ] = true
130
135
end
@@ -172,6 +177,7 @@ def clone!
172
177
exclude = @options [ :exclude ]
173
178
revision = @options [ :revision ]
174
179
username = @options [ :username ]
180
+ @localtime = @options [ :localtime ]
175
181
176
182
if rootistrunk
177
183
# Non-standard repository layout. The repository root is effectively 'trunk.'
@@ -205,6 +211,7 @@ def clone!
205
211
run_command ( "#{ git_config_command } svn.authorsfile #{ authors } " ) unless authors . nil?
206
212
207
213
cmd = "git svn fetch "
214
+ cmd += "--localtime " if @localtime
208
215
unless revision . nil?
209
216
range = revision . split ( ":" )
210
217
range [ 1 ] = "HEAD" unless range [ 1 ]
@@ -308,7 +315,9 @@ def fix_branches
308
315
svn_branches . delete_if { |b | b . strip !~ %r{^svn\/ } }
309
316
310
317
if @options [ :rebase ]
311
- run_command ( "git svn fetch" , true , true )
318
+ cmd = "git svn fetch"
319
+ cmd += " --localtime" if @localtime
320
+ run_command ( cmd , true , true )
312
321
end
313
322
314
323
svn_branches . each do |branch |
0 commit comments