devtools: fix mailmap check for parentheses

Message ID 20230626102403.2531582-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series devtools: fix mailmap check for parentheses |

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/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Thomas Monjalon June 26, 2023, 10:24 a.m. UTC
  When checking names having parentheses, the grep matching was failing.
It is fixed by escaping the open parenthesis.

Also, the mailmap path was relative to the root directory.
The path is made absolute.

Fixes: e83d41f0694d ("mailmap: add list of contributors")
Fixes: 83812de4f2f3 ("devtools: move mailmap check after patch applied")
Cc: stable@dpdk.org

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

Comments

Stephen Hemminger July 3, 2023, 11:40 p.m. UTC | #1
On Mon, 26 Jun 2023 12:24:03 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:

> When checking names having parentheses, the grep matching was failing.
> It is fixed by escaping the open parenthesis.
> 
> Also, the mailmap path was relative to the root directory.
> The path is made absolute.
> 
> Fixes: e83d41f0694d ("mailmap: add list of contributors")
> Fixes: 83812de4f2f3 ("devtools: move mailmap check after patch applied")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---

Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  
Thomas Monjalon July 6, 2023, 9:48 a.m. UTC | #2
04/07/2023 01:40, Stephen Hemminger:
> On Mon, 26 Jun 2023 12:24:03 +0200
> Thomas Monjalon <thomas@monjalon.net> wrote:
> 
> > When checking names having parentheses, the grep matching was failing.
> > It is fixed by escaping the open parenthesis.
> > 
> > Also, the mailmap path was relative to the root directory.
> > The path is made absolute.
> > 
> > Fixes: e83d41f0694d ("mailmap: add list of contributors")
> > Fixes: 83812de4f2f3 ("devtools: move mailmap check after patch applied")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> 
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>

Applied
  

Patch

diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh
index af751e49ab..89544a2cc5 100755
--- a/devtools/check-git-log.sh
+++ b/devtools/check-git-log.sh
@@ -264,8 +264,10 @@  names=$(git log --format='From: %an <%ae>%n%b' --reverse $range |
 	sed -rn 's,.*: (.*<.*@.*>),\1,p' |
 	sort -u)
 bad=$(for contributor in $names ; do
+	contributor=${contributor//(/\\(}
 	! grep -qE "^$contributor($| <)" $selfdir/../.mailmap || continue
-	if grep -q "^${contributor%% <*} <" .mailmap ; then
+	name=${contributor%% <*}
+	if grep -q "^$name <" $selfdir/../.mailmap ; then
 		printf "\t$contributor is not the primary email address\n"
 	else
 		printf "\t$contributor is unknown in .mailmap\n"