devtools: fix file listing in maintainers check

Message ID 20210615124949.411525-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series devtools: fix file listing in maintainers check |

Checks

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

Commit Message

Thomas Monjalon June 15, 2021, 12:49 p.m. UTC
  When having multiple working trees, the main one has a .git directory
while attached trees have a .git file.
Thus the git check should work for both file and directory.

In the case there is no working tree (.git not readable), the command
"find" is used and should be able to list paths with wildcards.
Wildcards work only as shell expansion in the case of file paths,
so the quotes must be removed.

Fixes: 27c2ce563216 ("maintainers: start a Linux-style file")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 devtools/check-maintainers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Thomas Monjalon June 23, 2021, 9:19 a.m. UTC | #1
15/06/2021 14:49, Thomas Monjalon:
> When having multiple working trees, the main one has a .git directory
> while attached trees have a .git file.
> Thus the git check should work for both file and directory.
> 
> In the case there is no working tree (.git not readable), the command
> "find" is used and should be able to list paths with wildcards.
> Wildcards work only as shell expansion in the case of file paths,
> so the quotes must be removed.
> 
> Fixes: 27c2ce563216 ("maintainers: start a Linux-style file")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Applied
  

Patch

diff --git a/devtools/check-maintainers.sh b/devtools/check-maintainers.sh
index df3f740b6e..71697bb352 100755
--- a/devtools/check-maintainers.sh
+++ b/devtools/check-maintainers.sh
@@ -15,10 +15,10 @@  files () # <path> [<path> ...]
 	if [ -z "$1" ] ; then
 		return
 	fi
-	if [ -d .git ] ; then
+	if [ -r .git ] ; then
 		git ls-files "$1"
 	else
-		find "$1" -type f |
+		find $1 -type f |
 		sed 's,^\./,,'
 	fi |
 	# if not ended by /