buildtools/check-git-log: print expected driver prefix

Message ID 20250124172434.1422621-1-bruce.richardson@intel.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series buildtools/check-git-log: print expected driver prefix |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS

Commit Message

Bruce Richardson Jan. 24, 2025, 5:24 p.m. UTC
When outputting an error for an invalid log prefix, don't just tell the
user that the prefix is wrong - also tell them what the expected prefix
should be.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/check-git-log.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
  

Patch

diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh
index 2ee7f2db64..9582f03dea 100755
--- a/devtools/check-git-log.sh
+++ b/devtools/check-git-log.sh
@@ -81,12 +81,13 @@  bad=$(for commit in $commits ; do
 	drv=$(echo "$files" | grep '^drivers/' | cut -d "/" -f 2,3 | sort -u)
 	drvgrp=$(echo "$drv" | cut -d "/" -f 1 | uniq)
 	if [ $(echo "$drvgrp" | wc -l) -gt 1 ] ; then
-		echo "$headline" | grep -v '^drivers:'
+		prefix='drivers:'
 	elif [ $(echo "$drv" | wc -l) -gt 1 ] ; then
-		echo "$headline" | grep -v "^drivers/$drvgrp"
+		prefix="drivers/$drvgrp:"
 	else
-		echo "$headline" | grep -v "^$drv"
+		prefix="$drv"
 	fi
+	echo "$headline (expected prefix \"$prefix\")" | grep -v "^$prefix"
 done | sed 's,^,\t,')
 [ -z "$bad" ] || { printf "Wrong headline prefix:\n$bad\n" && failure=true;}