def create_title_and_body(target_branch)
login = server.login
commits = git_call("log --format='%H' HEAD...#{target_branch}").
lines.count
puts "Commits: #{commits}"
if commits == 1
title = git_call("log --format='%s' HEAD...#{target_branch}").chomp
body = git_call("log --format='%b' HEAD...#{target_branch}").chomp
else
title = "[Review] Request from '#{login}' @ '#{source}'"
body = "Please review the following changes:\n"
body += git_call("log --oneline HEAD...#{target_branch}").
lines.map{|l| " * #{l.chomp}"}.join("\n")
end
edit_title_and_body(title, body)
end