Skip to content

Commit

Permalink
Return to storing darcs-hash in commit comments, but provide an optio…
Browse files Browse the repository at this point in the history
…n to disable it
  • Loading branch information
purcell committed May 12, 2008
1 parent 40bb362 commit ae775b5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions darcs-to-git
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# XXX: make backwards compatible
# TODO: import parallel darcs repos as git branches, identifying branch points
# TODO: use default repo if none was supplied
# TODO: handle *-darcs-backupN files?

require 'ostruct'
require 'rexml/document'
Expand All @@ -27,6 +28,7 @@ DEFAULT_AUTHOR_MAP_FILE = ".git/darcs_author_substitutions"
OPTIONS = { :default_email => nil,
:list_authors => false,
:author_map => nil,
:clean_commit_messages => false,
:num_patches => nil }
opts = OptionParser.new do |opts|
opts.banner = <<-end_usage
Expand Down Expand Up @@ -69,6 +71,10 @@ OPTIONS
abort opts.to_s unless n >= 0
OPTIONS[:num_patches] = n
end
opts.on('--clean-commit-messages',
"Don't note darcs hashes in git commit messages (not recommended)") do |n|
OPTIONS[:clean_commit_messages] = true
end
opts.on('-h', '--help', "Show this message") do
abort opts.to_s
end
Expand Down Expand Up @@ -159,6 +165,8 @@ class CommitHistory
raise "yaml hash not found in #{patch_file_name}"
end
else
# TODO: consider doing this unconditionally, since that
# might allow merging between repositories created with darcs-to-git
fill_from_darcs_hash_comments
end
end
Expand Down Expand Up @@ -227,9 +235,9 @@ class DarcsPatch

def git_commit_message
[ ((inverted ? "UNDO: #{name}" : name) unless name =~ /^\[\w+ @ \d+\]/),
comment
comment,
("darcs-hash:#{identifier}" unless OPTIONS[:clean_commit_messages])
].compact.join("\n\n")
# "darcs-hash:#{identifier}" ].compact.join("\n\n")
end

def self.read_from_repo(repo)
Expand Down

0 comments on commit ae775b5

Please sign in to comment.