Skip to contentSkip to conversation

devtools: relax headline prefix check

PATCH In review Tomasz Duszynski 2 participants 2 messages Jul 27, 2021 – Aug 6, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devtools: relax headline prefix check

In order to avoid code duplication common code shared across drivers is stored under drivers/common.

Currently if one needs to introduce changes to common and particular driver i.e common/driver and net/driver separate patches needs to be prepared otherwise warning about wrong headline prefix gets printed.

In order to avoid that script should allow cases where changes to drivers/common/driver and drivers/group/driver belong to the same patch.

---
 devtools/check-git-log.sh | 4 ++++
 1 file changed, 4 insertions(+)
devtools/check-git-log.sh +4 -0
index 9988bf863d..ee37e65ae4 100755
@@ -80,6 +80,10 @@ 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
+		if [ $(echo "$drvgrp" | grep -c "common") -eq 1 ] &&
+		   [ $(echo "$drvgrp" | grep -cv "common") -eq 1 ] ; then
+			continue
+		fi
 		echo "$headline" | grep -v '^drivers:'
 	elif [ $(echo "$drv" | wc -l) -gt 1 ] ; then
 		echo "$headline" | grep -v "^drivers/$drvgrp"

--
2.25.1

#1 lore raw

27/07/2021 15:19, Tomasz Duszynski:

Quoted 6 lines

In order to avoid code duplication common code shared across drivers is stored under drivers/common.

Currently if one needs to introduce changes to common and particular driver i.e common/driver and net/driver separate patches needs to be prepared otherwise warning about wrong headline prefix gets printed.

No please don't split patches just to make a script happy :) We can tolerate few warnings if not meaningful. But I agree it would be better to avoid such wrong warning.

Quoted 4 lines

In order to avoid that script should allow cases where changes to drivers/common/driver and drivers/group/driver belong to the same patch.

[...]

devtools/check-git-log.sh bad=$(for commit in $commits ; do · line 85

Quoted 9 lines
devtools/check-git-log.sh +3 -0
@@ -80,6 +80,10 @@ 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
+		if [ $(echo "$drvgrp" | grep -c "common") -eq 1 ] &&
+		   [ $(echo "$drvgrp" | grep -cv "common") -eq 1 ] ; then
+			continue

It means you allow one common subdir and exactly one non-common subdir. I think it is too much restrictive because it makes sense
to change a shared code and several related drivers.

Thanks for working on such improvement.