devtools: fix mailmap check for parentheses
Checks
Commit Message
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
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>
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
@@ -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"