Commit 5682b517 by Nicolas Capens Committed by Nicolas Capens

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: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent d79c7345
...@@ -40,13 +40,14 @@ function check() { ...@@ -40,13 +40,14 @@ function check() {
# Validate commit message # Validate commit message
function run_bug_in_commit_msg() { 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 ] if [ $? -ne 0 ]
then then
echo "Git commit message must have a Bug: line" echo "Git commit message must have a Bug: line"
echo "followed by a bug ID in the form b/# for Buganizer bugs or" 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 "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 return 1
fi fi
} }
......
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