Commit da4bfad4 authored by ilevy@chromium.org's avatar ilevy@chromium.org

Make drover produce git friendly titles.

Put a blank line in between drover title and message.
Also include snippet of commit title in drover title,
but keep total title line length below 50 chars.


Review URL: https://chromiumcodereview.appspot.com/12656003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@187329 0039d316-1c4b-4281-b951-d872f2087c98
parent 059cc450
......@@ -595,10 +595,19 @@ def drover(options, args):
filename = str(revision)+".txt"
out = open(filename,"w")
out.write(action +" " + str(revision) + "\n")
for line in getRevisionLog(url, revision).splitlines():
drover_title = '%s %s' % (action, revision)
revision_log = getRevisionLog(url, revision).splitlines()
if revision_log:
commit_title = revision_log[0]
# Limit title to 68 chars so git log --oneline is <80 chars.
max_commit_title = 68 - (len(drover_title) + 3)
if len(commit_title) > max_commit_title:
commit_title = commit_title[:max_commit_title-3] + '...'
drover_title += ' "%s"' % commit_title
out.write(drover_title + '\n\n')
for line in revision_log:
out.write('> %s\n' % line)
if (author):
if author:
out.write("\nTBR=" + author)
out.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment