aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-04-08 10:37:20 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-04-08 08:50:39 +0000
commit7591ebb5a316612a482e53eac94d661e1cc18142 (patch)
treef97d68d868d10de6700694bf14e392582322b976 /tools
parentca620dd8f97f5b3a9134b687b5584203019518fb (diff)
tools: print regex pattern in check-commits.sh
To make it more clear what is the actual check.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check-commits.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/check-commits.sh b/tools/check-commits.sh
index f0bfa8b63..512ce76ae 100755
--- a/tools/check-commits.sh
+++ b/tools/check-commits.sh
@@ -23,10 +23,12 @@ for HASH in ${HASHES}; do
((COMMITS+=1))
SUBJECT=$(git show --format="%s" --no-patch ${HASH})
BODY=$(git show --format="%B" --no-patch ${HASH})
- if ! [[ ${SUBJECT} =~ ^(Revert \"|(([a-z0-9/_.-]+|Makefile|CONTRIBUTORS|README.md)(, )?)+:\ [^A-Z].+[^.]$) ]]; then
+ PATTERN="^(Revert \"|(([a-z0-9/_.-]+|Makefile|CONTRIBUTORS|README.md)(, )?)+:\ [^A-Z].+[^.]$)"
+ if ! [[ ${SUBJECT} =~ $PATTERN ]]; then
echo "##[error]Wrong commit subject format: '${SUBJECT}'.\
Please use 'main/affected/package: short change description'.\
- See docs/contributing.md for details."
+ See docs/contributing.md for details.\
+ Regex pattern used to check commit subjects is '$PATTERN'."
FAILED="1"
fi
LONGLINE='[^\