Skip to contentSkip to conversation

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

PATCH In review Bruce Richardson 2 participants 2 messages Jan 24, 2025 – Jul 21, 2025

lore
Share & tools
lore
#0 lore raw

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

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.

---
 devtools/check-git-log.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
devtools/check-git-log.sh +4 -3
index 2ee7f2db64..9582f03dea 100755
@@ -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;}
 
Signature · 1 line
2.43.0
#1 lore raw

24/01/2025 18:24, Bruce Richardson:

Quoted 5 lines

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.

Applied (with fixed prefix :), thanks.