From 7591ebb5a316612a482e53eac94d661e1cc18142 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 8 Apr 2024 10:37:20 +0200 Subject: tools: print regex pattern in check-commits.sh To make it more clear what is the actual check. --- tools/check-commits.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tools') 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='[^\ -- cgit mrf-deployment