public
Description: Make git mirrors of darcs repositories
Homepage: http://www.sanityinc.com/articles/converting-darcs-repositories-to-git
Clone URL: git://github.com/purcell/darcs-to-git.git
Click here to lend your support to: darcs-to-git and make a donation at www.pledgie.com !
Return to storing darcs-hash in commit comments, but provide an option to 
disable it
purcell (author)
Mon May 12 07:42:17 -0700 2008
commit  ae775b5a48508961c67b56aabeece8fb7fd763ed
tree    05323824a3235ac952174ab8129d737cd3fb2778
parent  40bb3629a7c9cd85f2b6914b81fcb40885400999
...
7
8
9
 
10
11
12
...
27
28
29
 
30
31
32
...
69
70
71
 
 
 
 
72
73
74
...
159
160
161
 
 
162
163
164
...
227
228
229
230
 
 
231
232
233
234
235
...
7
8
9
10
11
12
13
...
28
29
30
31
32
33
34
...
71
72
73
74
75
76
77
78
79
80
...
165
166
167
168
169
170
171
172
...
235
236
237
 
238
239
240
 
241
242
243
0
@@ -7,6 +7,7 @@
0
 # XXX: make backwards compatible
0
 # TODO: import parallel darcs repos as git branches, identifying branch points
0
 # TODO: use default repo if none was supplied
0
+# TODO: handle *-darcs-backupN files?
0
 
0
 require 'ostruct'
0
 require 'rexml/document'
0
@@ -27,6 +28,7 @@ DEFAULT_AUTHOR_MAP_FILE = ".git/darcs_author_substitutions"
0
 OPTIONS = { :default_email => nil,
0
             :list_authors => false,
0
             :author_map => nil,
0
+ :clean_commit_messages => false,
0
             :num_patches => nil }
0
 opts = OptionParser.new do |opts|
0
   opts.banner = <<-end_usage
0
@@ -69,6 +71,10 @@ OPTIONS
0
     abort opts.to_s unless n >= 0
0
     OPTIONS[:num_patches] = n
0
   end
0
+ opts.on('--clean-commit-messages',
0
+ "Don't note darcs hashes in git commit messages (not recommended)") do |n|
0
+ OPTIONS[:clean_commit_messages] = true
0
+ end
0
   opts.on('-h', '--help', "Show this message") do
0
     abort opts.to_s
0
   end
0
@@ -159,6 +165,8 @@ class CommitHistory
0
         raise "yaml hash not found in #{patch_file_name}"
0
       end
0
     else
0
+ # TODO: consider doing this unconditionally, since that
0
+ # might allow merging between repositories created with darcs-to-git
0
       fill_from_darcs_hash_comments
0
     end
0
   end
0
@@ -227,9 +235,9 @@ class DarcsPatch
0
 
0
   def git_commit_message
0
     [ ((inverted ? "UNDO: #{name}" : name) unless name =~ /^\[\w+ @ \d+\]/),
0
- comment
0
+ comment,
0
+ ("darcs-hash:#{identifier}" unless OPTIONS[:clean_commit_messages])
0
     ].compact.join("\n\n")
0
- # "darcs-hash:#{identifier}" ].compact.join("\n\n")
0
   end
0
 
0
   def self.read_from_repo(repo)

Comments

    No one has commented yet.