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.

While at it, fix Zhirun mail address in mailmap and add Jian and Srikanth.

Signed-off-by: David Marchand <[email protected]>
---
Changes since v1:
- merged patch 1,
- added Jian and Srikanth to .mailmap,

---
 .mailmap                      |  4 +++-
 devtools/check-maintainers.sh | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index f76037213d..31383bc782 100644
--- a/.mailmap
+++ b/.mailmap
@@ -645,6 +645,7 @@ Jesper Wramberg <[email protected]>
 Jesse Brandeburg <[email protected]>
 Jesse Bruni <[email protected]>
 Jia He <[email protected]> <[email protected]>
+Jian Wang <[email protected]>
 Jianbo Liu <[email protected]> <[email protected]>
 Jianfeng Tan <[email protected]>
 Jiang Yu <[email protected]>
@@ -1378,6 +1379,7 @@ Souvik Dey <[email protected]> <[email protected]>
 Spike Du <[email protected]>
 Sridhar Samudrala <[email protected]>
 Sriharsha Basavapatna <[email protected]>
+Srikanth Jampala <[email protected]>
 Srikanth Yalavarthi <[email protected]>
 Srinivas Narayan <[email protected]>
 Srisivasubramanian Srinivasan <[email protected]> 
<[email protected]>
@@ -1711,7 +1713,7 @@ Zhihong Wang <[email protected]> 
<[email protected]>
 Zhike Wang <[email protected]> <[email protected]>
 Zhimin Huang <[email protected]>
 Zhipeng Lu <[email protected]>
-Zhirun Yan <[email protected]>
+Zhirun Yan <[email protected]> <[email protected]>
 Zhiwei He <[email protected]>
 Zhiyong Yang <[email protected]>
 Zhuobin Huang <[email protected]>
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.45.2

Reply via email to