Skip to contentSkip to conversation

devtools: fix mailmap check for parentheses

PATCH In review Thomas Monjalon 2 participants 3 messages Jun 26, 2023 – Jul 6, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devtools: fix mailmap check for parentheses

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")
---
 devtools/check-git-log.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
devtools/check-git-log.sh +3 -1
index af751e49ab..89544a2cc5 100755
@@ -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"
Signature · 1 line
2.41.0
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Mon, 26 Jun 2023 12:24:03 +0200 Thomas Monjalon <[email protected]> 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.

Quoted 6 lines
Fixes e83d41f0694d ("mailmap: add list of contributors")
Fixes 83812de4f2f3 ("devtools: move mailmap check after patch applied")

---

author Applied
#2 lore raw

04/07/2023 01:40, Stephen Hemminger:

Quoted 9 lines
Quoted 6 lines · On Mon, 26 Jun 2023 12:24:03 +0200 Thomas Monjalon <[email protected]> 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.

Quoted 8 lines
Quoted 6 lines
Fixes e83d41f0694d ("mailmap: add list of contributors")
Fixes 83812de4f2f3 ("devtools: move mailmap check after patch applied")

---

Applied