Skip to contentSkip to conversation

devtools: fix bad substitution

PATCH Applied Raslan Darawsheh 2 participants 2 messages Jul 11, 2023 – Jul 12, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devtools: fix bad substitution

When running check-git-log, it showed a Bad substitution.

It is fixed by using tr to escape the open parenthesis.

Fixes 6fd14c1b58e6 ("devtools: fix mailmap check for parentheses")
---
 devtools/check-git-log.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/check-git-log.sh +1 -1
index 89544a2cc5..5c869b7683 100755
@@ -264,7 +264,7 @@ 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//(/\\(}
+	contributor=$(echo $contributor | tr '(' '\\(')
 	! grep -qE "^$contributor($| <)" $selfdir/../.mailmap || continue
 	name=${contributor%% <*}
 	if grep -q "^$name <" $selfdir/../.mailmap ; then
Signature · 1 line
2.25.1
#1 lore raw

11/07/2023 09:16, Raslan Darawsheh:

Quoted 18 lines

When running check-git-log, it showed a Bad substitution.

It is fixed by using tr to escape the open parenthesis.

Fixes 6fd14c1b58e6 ("devtools: fix mailmap check for parentheses")
---
 devtools/check-git-log.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/check-git-log.sh +0 -0
index 89544a2cc5..5c869b7683 100755

devtools/check-git-log.sh names=$(git log --format='From: %an <%ae>%n%b' --reverse $range | · line 267

Quoted 5 lines
devtools/check-git-log.sh +1 -1
@@ -264,7 +264,7 @@ 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//(/\\(}
+	contributor=$(echo $contributor | tr '(' '\\(')

tr was not working here, replaced with sed

Applied, thanks.