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 <david.march...@redhat.com>
---
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 <jesper.wramb...@gmail.com>
 Jesse Brandeburg <jesse.brandeb...@intel.com>
 Jesse Bruni <jesse.br...@intel.com>
 Jia He <justin...@arm.com> <jia...@hxt-semitech.com>
+Jian Wang <jianw...@trustnetic.com>
 Jianbo Liu <jianbo....@arm.com> <jianbo....@linaro.org>
 Jianfeng Tan <jianfeng....@intel.com>
 Jiang Yu <yux.ji...@intel.com>
@@ -1378,6 +1379,7 @@ Souvik Dey <so...@rbbn.com> <so...@sonusnet.com>
 Spike Du <spi...@nvidia.com>
 Sridhar Samudrala <sridhar.samudr...@intel.com>
 Sriharsha Basavapatna <sriharsha.basavapa...@broadcom.com>
+Srikanth Jampala <jsrika...@marvell.com>
 Srikanth Yalavarthi <syalavar...@marvell.com>
 Srinivas Narayan <srinivas.nara...@att.com>
 Srisivasubramanian Srinivasan <sriniva...@marvell.com> 
<ssriniva...@caviumnetworks.com>
@@ -1711,7 +1713,7 @@ Zhihong Wang <wangzhihong....@bytedance.com> 
<zhihong.w...@intel.com>
 Zhike Wang <wangzh...@jd.com> <wangzk...@163.com>
 Zhimin Huang <zhiminx.hu...@intel.com>
 Zhipeng Lu <luzhip...@cestc.cn>
-Zhirun Yan <zhirun....@intel.com>
+Zhirun Yan <yanzhirun_...@163.com> <zhirun....@intel.com>
 Zhiwei He <zhiwei...@intel.com>
 Zhiyong Yang <zhiyong.y...@intel.com>
 Zhuobin Huang <zobin1...@gmail.com>
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