CMD = ARGV.shift || 'svn'
MSG = ARGV.shift || ''

files = []
file = nil
`#{CMD} diff`.each{|line|
  case line
  when /@@.+@@\s+((\w+)|(?:\w+\s+(\w+)))\(/
    func = $2 || $3
    files << "#{file} (#{func})"
  when /\+\+\+ (.+)\t\(.+\)/
    file = $1
    files << $1
  end
  puts line
}

#"%Y-%m-%d(%a) %H:%M:%S %Z"
puts "#{Time.now.strftime('%Y-%m-%d(%a) %H:%M:%S +0900')}  Koichi Sasada  <ko1@atdot.net>"
puts
files.sort.each{|file|
  puts "\t* #{file} : #{MSG}"
  puts
}
