Allow verbal bug IDs In rare cases the requirement to have a Buganizer or Monorail bug ID in the commit message can be unreasonable. For example when the build is broken and the fix is trivial so the creation of a tracker bug would needlessly take valuable time. Another example would be fixing a spelling mistake in a comment and we don't want to spam the tracker thread with a commit notification. For such cases, accept bug info lines containing no digits. Bug: b/141892461 Change-Id: Iaf44eb3dfc08d3e138fe8ba24501fa9c046d36de Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/40029 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by: Alexis Hétu <sugoi@google.com> Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/tests/presubmit.sh b/tests/presubmit.sh index 87ac54c..4ba0d16 100755 --- a/tests/presubmit.sh +++ b/tests/presubmit.sh
@@ -40,13 +40,14 @@ # Validate commit message function run_bug_in_commit_msg() { - git log -1 --pretty=%B | grep -E '^(Bug|Issue|Fixes):(\s?)((b\/)|(\w+:))([0-9]+)$|(^Regres:)' + git log -1 --pretty=%B | grep -E '^(Bug|Issue|Fixes):(\s?)(((b\/)|(\w+:))([0-9]+)|[^0-9]+)$|(^Regres:)' if [ $? -ne 0 ] then echo "Git commit message must have a Bug: line" echo "followed by a bug ID in the form b/# for Buganizer bugs or" echo "project:# for Monorail bugs (e.g. 'Bug: chromium:123')." + echo "Omit any digits when no ID is required (e.g. 'Bug: fix build')." return 1 fi }