devtools: relax headline prefix check

Message ID 20210727131917.120743-1-tduszynski@marvell.com (mailing list archive)
State Rejected, archived
Delegated to: Thomas Monjalon
Headers
Series devtools: relax headline prefix check |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot success github build: passed
ci/Intel-compilation success Compilation OK
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Tomasz Duszynski July 27, 2021, 1:19 p.m. UTC
  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.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
---
 devtools/check-git-log.sh | 4 ++++
 1 file changed, 4 insertions(+)

--
2.25.1
  

Comments

Thomas Monjalon Aug. 6, 2021, 3:08 p.m. UTC | #1
27/07/2021 15:19, Tomasz Duszynski:
> 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.

> In order to avoid that script should allow cases where changes to
> drivers/common/driver and drivers/group/driver belong to the same patch.
> 
> Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
[...]
> --- a/devtools/check-git-log.sh
> +++ b/devtools/check-git-log.sh
> @@ -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.
  

Patch

diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh
index 9988bf863d..ee37e65ae4 100755
--- a/devtools/check-git-log.sh
+++ b/devtools/check-git-log.sh
@@ -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"