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

David Marchand david.marchand at redhat.com
Fri Mar 22 17:14:06 CET 2024


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 at redhat.com>
---
 devtools/check-maintainers.sh | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

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
-- 
2.44.0



More information about the dev mailing list