commit | 983f73fe65d500c517dd484fe670d0527c00063a | [log] [tgz] |
---|---|---|
author | Rob Mohr <mohrr@google.com> | Fri Mar 12 08:49:36 2021 -0800 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Mar 12 17:27:02 2021 +0000 |
tree | ca943299283207e5c57c9e424cfb391a5aa409ed | |
parent | 2868e079f93644efb4b8077f64ea7675fd858cd1 [diff] |
pw_presubmit: Ignore reverts in commit message check Change-Id: I4b25120e9fc4181fbbd783b3ecb202692fa1e4fd Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/37329 Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com> Reviewed-by: Keir Mierle <keir@google.com> Commit-Queue: Rob Mohr <mohrr@google.com>
diff --git a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py index d136b77..a0ec61f 100755 --- a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py +++ b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
@@ -473,6 +473,13 @@ for line in lines: _LOG.debug(line) + # Ignore Gerrit-generated reverts. + if ('Revert' in lines[0] + and 'This reverts commit ' in git_repo.commit_message() + and 'Reason for revert: ' in git_repo.commit_message()): + _LOG.warning('Ignoring apparent Gerrit-generated revert') + return + if not lines: _LOG.error('The commit message is too short!') raise PresubmitFailure