[2/2] devtools: check that maintainers are listed in mailmap

Message ID 20240322161406.996890-2-david.marchand@redhat.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series [1/2] mailmap: fix outdated entry for Zhirun |

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/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

David Marchand March 22, 2024, 4:14 p.m. UTC
  When a maintainer changes its mail address, check that the associated
entry in .mailmap knows this address, otherwise there is a chance
.mailmap points at an obsolete address.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/check-maintainers.sh | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
  

Patch

diff --git a/devtools/check-maintainers.sh b/devtools/check-maintainers.sh
index 71697bb352..8a786e14a9 100755
--- a/devtools/check-maintainers.sh
+++ b/devtools/check-maintainers.sh
@@ -85,6 +85,18 @@  check_fx () # <index file>
 	done
 }
 
+# Check that every maintainer mail is known of .mailmap:
+check_mailmap () # <index file> <mailmap file>
+{
+	sed -n -e 's/^M: \(.*<.*\)$/\1/p' $1 | sort -u | while read line; do
+		name=${line%% <*}
+		mail='<'${line##* <}
+		if ! grep -q "^$name <" $2 || ! grep -iq "^$name.*$mail" $2; then
+			echo $name mail address $mail is not in $2
+		fi
+	done
+}
+
 # Add a line to a set of lines if it begins with right pattern
 add_line_to_if () # <new line> <lines> <head pattern>
 {
@@ -129,4 +141,10 @@  echo '# wrong patterns'
 echo '##########'
 check_fx MAINTAINERS
 
+echo
+echo '##########'
+echo '# wrong mailmap'
+echo '##########'
+check_mailmap MAINTAINERS .mailmap
+
 # TODO: check overlaps