]> xenbits.xensource.com Git - libvirt.git/commitdiff
maint: new syntax-check rule to ensure that AUTHORS stays in sync
authorJim Meyering <meyering@redhat.com>
Fri, 28 May 2010 09:27:12 +0000 (11:27 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 28 May 2010 13:02:04 +0000 (15:02 +0200)
* cfg.mk (sc_check_AUTHOR_list): New rule.
* .mailmap: New file, to tell git log how to map email addresses.

.mailmap [new file with mode: 0644]
cfg.mk

diff --git a/.mailmap b/.mailmap
new file mode 100644 (file)
index 0000000..dff04b9
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,12 @@
+<amy.griffis@hp.com> <aron.griffis@hp.com>
+<bozzolan@gmail.com> <redshift@gmx.com>
+<charles_duffy@messageone.com> <charles@dyfis.net>
+<dfj@redhat.com> <dfj@dfj.bne.redhat.com>
+<eblake@redhat.com> <ebb9@byu.net>
+<gdolley@arpnetworks.com> <gdolley@ucla.edu>
+<gerhard.stenzel@de.ibm.com> <gstenzel@linux.vnet.ibm.com>
+<jamie@canonical.com> <jamie@ubuntu.com>
+<laine@redhat.com> <laine@laine.org>
+<meyering@redhat.com> <jim@meyering.net>
+<socketpair@gmail.com> <socketpair gmail com>
+<soren@canonical.com> <soren@ubuntu.com>
diff --git a/cfg.mk b/cfg.mk
index bdf9ea9da40fa079b3688dd099ac9250661bdddb..1f63a804d91b7417d53cadf77275d46d98b018be 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -472,6 +472,20 @@ Makefile: _autogen
   endif
 endif
 
+# Give credit where due:
+# Ensure that each commit author email address (possibly mapped via
+# git log's .mailmap) appears in our AUTHORS file.
+sc_check_author_list:
+       @fail=0;                                                        \
+       for i in $$(git log --pretty=format:%aE%n|sort -u|grep -v '^$$'); do \
+         sanitized=$$(echo "$$i"|LC_ALL=C sed 's/\([^a-zA-Z0-9_@-]\)/\\\1/g'); \
+         grep -iq "<$$sanitized>" AUTHORS                              \
+           || { printf '%s\n' "$$i" >&2; fail=1; };                    \
+       done;                                                           \
+       test $$fail = 1                                                 \
+         && echo '$(ME): committer(s) not listed in AUTHORS' >&2;      \
+       test $$fail = 0
+
 # It is necessary to call autogen any time gnulib changes.  Autogen
 # reruns configure, then we regenerate all Makefiles at once.
 .PHONY: _autogen