From 600d309d6c17d2b6cbf69cd971fa641d0505155c Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Wed, 8 Mar 2017 12:58:18 -0500 Subject: [PATCH] git-cl: Recognize Bug: when reading change descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When git-cl doesn’t see a BUG= line, it introduces a new one. The eventual goal is to switch away from THIS=TYPE of metadata to the footer field style that’s more natural to git and, most importantly, Gerrit. With this change, git-cl will treat an existing Bug: line identically to a BUG= line, and not introduce a new BUG= line if either are present. This stops short of switching the default format to Bug:, but it allows projects that wish to switch to the new format now to not be pestered by git-cl introducing BUG= every time it edits a change description. This is similar to the bug line parsing done by Bugdroid, which already undersatnds the Bug: format. See https://chromium.googlesource.com/infra/infra/+/ba095768d776/infra/services/bugdroid/log_parser.py. BUG=616753 Change-Id: I23faa55c8275de44b71b031e603f2f55778d7f25 Reviewed-on: https://chromium-review.googlesource.com/451123 Commit-Queue: Mark Mentovai Reviewed-by: Andrii Shyshkalov --- git_cl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git_cl.py b/git_cl.py index c06fc87cd..f3eb5ed5d 100755 --- a/git_cl.py +++ b/git_cl.py @@ -3034,7 +3034,7 @@ class ChangeDescription(object): """Contains a parsed form of the change description.""" R_LINE = r'^[ \t]*(TBR|R)[ \t]*=[ \t]*(.*?)[ \t]*$' CC_LINE = r'^[ \t]*(CC)[ \t]*=[ \t]*(.*?)[ \t]*$' - BUG_LINE = r'^[ \t]*(BUG)[ \t]*=[ \t]*(.*?)[ \t]*$' + BUG_LINE = r'^[ \t]*(BUGS?|Bugs?)[ \t]*[:=][ \t]*(.*?)[ \t]*$' CHERRY_PICK_LINE = r'^\(cherry picked from commit [a-fA-F0-9]{40}\)$' def __init__(self, description):