Generate much of the CREDITS file from git log

* CREDITS.in: New file, derived from CREDITS, without names of
those who are listed as git log 'Author:'s.
* CREDITS: Remove file.
* Makefile.am [MAINTAINER_MODE] (CREDITS): New rule.
* .gitignore: Add CREDITS.
* .mailmap: New file, required to map git author names and email
addresses to canonical/preferred form.
diff --git a/.gitignore b/.gitignore
index 9f17271..6292c94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
 .*.swp
 
 ChangeLog
+CREDITS
 
 Makefile
 Makefile.in
diff --git a/.mailmap b/.mailmap
new file mode 100644
index 0000000..8b27b94
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,4 @@
+# Map git author names and email addresses to canonical/preferred form.
+<holger@freyther.de>	<zecke@selfish.org>
+<schwab@linux-m68k.org>	<schwab@redhat.com>
+<schwab@linux-m68k.org>	<schwab@suse.de>
diff --git a/CREDITS b/CREDITS
deleted file mode 100644
index 1b6600f..0000000
--- a/CREDITS
+++ /dev/null
@@ -1,49 +0,0 @@
-The primary authors of strace are:
-
-	Paul Kranenburg <pk@cs.few.eur.nl>
-	Branko Lankester <branko@hacktic.nl>
-	Rick Sladkey <jrs@world.std.com>
-
-Thanks to the follow people for contributing to strace by reporting
-bugs, providing fixes, providing information, providing resources or
-porting to new systems:
-
-	Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-	Arkadiusz Miskiewicz <misiek@pld.org.pl>
-	Marty Leisner <leisner@sdsp.mc.xerox.com>
-	Lupe Christoph <lupe@alanya.isar.muc.de>
-	Thanh Ma <tma@encore.com>
-	Keith Thompson <kst@alsys.com>
-	Roland Borde <bo@uebemc.siemens.de>
-	Matt Day <mday@artisoft.com>
-	Joe Ilacqua <spike@world.std.com>
-	Ju"rgen Fluk <louis@marco.de>
-	Bo Kullmar <bk@kullmar.se>
-	Leonard N. Zubkoff <lnz@dandelion.com>
-	Reuben Sumner <rasumner@undergrad.math.uwaterloo.ca>
-	Juergen Weigert <jnweiger@immd4.informatik.uni-erlangen.de>
-	Linus Torvalds <Linus.Torvalds@cs.Helsinki.FI>
-	Michael E Chastain <mec@duracef.shout.net>
-	Aaron Ucko <UCKO@VAX1.ROCKHURST.EDU>
-	David S. Miller <davem@caip.rutgers.edu>
-	Matthias Pfaller <leo@dachau.marco.de>
-	Thomas Bogendoerfer <tsbogend@bigbug.franken.de>
-	Richard Henderson <richard@twiddle.tamu.edu>
-	Tom Dyas <tdyas@eden.rutgers.edu>
-	Henrik Storner <storner@osiris.ping.dk>
-	David Mosberger-Tang <davidm@hpl.hp.com>
-	Ulrich Drepper <drepper@cygnus.com>
-	Nate Eldredge <nate@cartsys.com>
-	Jakub Jelinek <jj@ultra.linux.cz>
-	John Hughes <john@Calva.COM>
-	Richard Braakman <dark@xs4all.nl>
-	Florian Lohoff <flo@rfc822.org>
-	D.J. Barrow <djbarrow@de.ibm.com>
-	Topi Miettinen <Topi.Miettinen@nic.fi>
-	Gaël Roualland <gael.roualland@iname.com>
-	Richard Hirst <rhirst@linuxcare.com>
-	Ganesan Rajagopal <rganesan@myrealbox.com>
-	Greg Banks <gbanks@pocketpenguins.com>
-	Andi Kleen <ak@suse.de>
-	Michal Ludvig <mludvig@suse.cz>
-	Heiko Carstens <heiko.carstens@de.ibm.com>
diff --git a/CREDITS.in b/CREDITS.in
new file mode 100644
index 0000000..1a6d984
--- /dev/null
+++ b/CREDITS.in
@@ -0,0 +1,91 @@
+The primary authors of strace was:
+
+	Paul Kranenburg <pk@cs.few.eur.nl>
+	Branko Lankester <branko@hacktic.nl>
+	Rick Sladkey <jrs@world.std.com>
+
+These people have contributed to strace.  Some have reported problems, others
+have contributed improvements to the documentation, actual code, provided
+information, provided resources, or helped to port strace to new systems.
+Those contributions are described in the version control logs and ChangeLog-CVS
+file.  If your name has been left out, if you'd rather not be listed, or if
+you'd prefer a different address be used, please send a note to the
+strace-devel@lists.sourceforge.net mailing list.
+
+##<
+## There is no need to list here any name that appears as an Author in
+## "git log" output.  Those are automatically added when this template
+## is used to generate the CREDITS file.
+##>
+Aaron Ucko                      ucko@vax1.rockhurst.edu
+Adrien Kunysz                   adrien@kunysz.be
+Andi Kleen                      ak@suse.de
+Anton Blanchard                 anton@samba.org
+Arkadiusz Miskiewicz            misiek@pld.org.pl
+Bai Weidong                     baiwd@cn.fujitsu.com
+Bo Kullmar                      bk@kullmar.se
+Cai Fei                         caifei@cn.fujitsu.com
+D.J. Barrow                     djbarrow@de.ibm.com
+David Mosberger-Tang            davidm@hpl.hp.com
+David S. Miller                 davem@caip.rutgers.edu
+David Wilder                    wilder@us.ibm.com
+David Woodhouse                 dwmw2@redhat.com
+Douglas Mencken                 dougmencken@gmail.com
+Fernando Luis Vazquez Cao       fernando@oss.ntt.co.jp
+Florian Lohoff                  flo@rfc822.org
+Gabor Gombas                    gombasg@sztaki.hu
+Ganesan Rajagopal               rganesan@myrealbox.com
+Gaël Roualland                  gael.roualland@iname.com
+Greg Banks                      gbanks@pocketpenguins.com
+Henrik Storner                  storner@osiris.ping.dk
+Jakub Jelinek                   jj@ultra.linux.cz
+Jeff Mahoney                    jeffm@suse.com
+Joe Ilacqua                     spike@world.std.com
+Johannes Stezenbach             js@sig21.net
+Ju"rgen Fluk                    louis@marco.de
+Juergen Weigert                 jnweiger@immd4.informatik.uni-erlangen.de
+Keith Thompson                  kst@alsys.com
+Kyle McMartin                   kyle@mcmartin.ca
+Lai JiangShan                   laijs@cn.fujitsu.com
+Leonard N. Zubkoff              lnz@dandelion.com
+Linus Torvalds                  Linus.Torvalds@cs.helsinki.fi
+Lupe Christoph                  lupe@alanya.isar.muc.de
+Marty Leisner                   leisner@sdsp.mc.xerox.com
+Matt Day                        mday@artisoft.com
+Matthias Pfaller                leo@dachau.marco.de
+Maxim Shchetynin                maxim@de.ibm.com
+Michael E Chastain              mec@duracef.shout.net
+Michael Holzheu                 holzheu@de.ibm.com
+Michail Litvak                  mci@owl.openwall.com
+Mike Stroyan                    mike.stroyan@hp.com
+Muttley Meen                    muttley.meen@gmail.com
+Nate Eldredge                   nate@cartsys.com
+Paul Mundt                      lethal@linux-sh.org
+Peter Jones                     pjones@redhat.com
+Pádraig Brady                   P@draigBrady.com
+Rajeev V. Pillai                rajeevvp@gmail.com
+Randolph Chung                  tausq@debian.org
+Reuben Sumner                   rasumner@undergrad.math.uwaterloo.ca
+Richard Braakman                dark@xs4all.nl
+Richard Henderson               richard@twiddle.tamu.edu
+Richard Hirst                   rhirst@linuxcare.com
+Roland Borde                    bo@uebemc.siemens.de
+Sami Farin                      safari@u.safari.iki.fi
+Scott Tsai                      scottt958@yahoo.com.tw
+Simon Murray                    simon@transitive.com
+Solar Designer                  solar@openwall.com
+Srinivasa Ds                    srinivasa@in.ibm.com
+Steve Bennett                   steveb@workware.net.au
+Thanh Ma                        tma@encore.com
+Thiemo Seufer                   ths@networkno.de
+Thomas Bogendoerfer             tsbogend@bigbug.franken.de
+Tim Yamin                       plasmaroo@gentoo.org
+Timo Lindfors                   timo.lindfors@iki.fi
+Tom Dyas                        tdyas@eden.rutgers.edu
+Tommi Rantala                   ext-tommi.1.rantala@nokia.com
+Topi Miettinen                  Topi.Miettinen@nic.fi
+Xiaoning Ding                   dingxn@gmail.com
+Yang Zhiguo                     yzgcsu@cn.fujitsu.com
+Zach Brown                      zach.brown@oracle.com
+Zhang Le                        zhilg@users.sourceforge.net
+Марк Коренберг                  socketpair@gmail.com
diff --git a/Makefile.am b/Makefile.am
index 3c15e06..4082cb3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -107,6 +107,18 @@
 	chmod 444 $@.new
 	mv -f $@.new $@
 
+$(srcdir)/CREDITS: $(top_srcdir)/CREDITS.in $(top_srcdir)/.mailmap \
+		   $(srcdir)/Makefile.in
+	$(AM_V_GEN)							\
+	{								\
+	  cd $(top_srcdir);						\
+	  sed '/^##/,$$d' CREDITS.in;					\
+	  { sed -n '1,/^##>/d; s/  \+/\t/; s/^./&/p' CREDITS.in;	\
+	    git log --pretty=format:'%aN	%aE';			\
+	  } | LC_ALL=C sort -u						\
+	    | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}';		\
+	} > $@-t && mv $@-t $@
+
 export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX
 
 if LINUX