Skip to content

Instantly share code, notes, and snippets.

@masao
Last active December 15, 2015 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masao/5344493 to your computer and use it in GitHub Desktop.
Save masao/5344493 to your computer and use it in GitHub Desktop.
Fix log messages for converting dump using cvs2git.
#!/usr/bin/env ruby
require "nkf"
ARGF.each do |line|
case line
when /^data\s+(\d+)$/
log_msg = ARGF.read( $1.to_i )
log_msg = NKF.nkf( "-wm0", log_msg )
puts "data #{ log_msg.size }"
print log_msg
when /^committer\s+/
line.sub!( /masao(\s+\<\>)?/, "masao <tmasao@acm.org>" )
line.sub!( /yuka(\s+\<\>)?/, "yegusa <yuka@nier.go.jp>" )
print line
else
print line
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment