Commit 2377b01e authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Treat "Bug:" as an empty line in git cl upload

The default description in the editor when you invoke "git cl upload"
includes recent commit descriptions, some blank lines and comments, and
"Bug: ". The upload script properly strips out the comments but was
leaving in the "Bug:" line. This leads to CLs with blank Bug: lines,
which is sloppy. It also means that if a user changes their mind and
closes the upload editor without adding any content... they would still
have a CL created.

This change removes the "Bug: " line if nothing has been added to it,
thus avoiding uploading a change with an empty description, and avoiding
having meaningless Bug: lines.

Change-Id: I18c2094e5712d31729899c0ebd0a52de97dc4e7f
Reviewed-on: https://chromium-review.googlesource.com/861920Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
parent da669d61
......@@ -3473,8 +3473,9 @@ class ChangeDescription(object):
DieWithError('Running editor failed')
lines = content.splitlines()
# Strip off comments.
clean_lines = [line.rstrip() for line in lines if not line.startswith('#')]
# Strip off comments and default inserted "Bug:" line.
clean_lines = [line.rstrip() for line in lines if not
(line.startswith('#') or line.rstrip() == "Bug:")]
if not clean_lines:
DieWithError('No CL description, aborting')
self.set_description(clean_lines)
......
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