[Libosinfo] [PATCH] Auto-generate AUTHORS file from GIT logs

Daniel P. Berrange berrange at redhat.com
Mon Apr 8 15:51:31 UTC 2013


From: "Daniel P. Berrange" <berrange at redhat.com>

Rather than trying to manually keep track of authors,
just auto-generate the list from GIT logs

Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
---
 .gitignore  |  2 ++
 AUTHORS     | 29 -----------------------------
 AUTHORS.in  | 19 +++++++++++++++++++
 ChangeLog   |  4 ----
 Makefile.am | 16 ++++++++++++----
 autogen.sh  |  5 +++++
 cfg.mk      | 16 ----------------
 7 files changed, 38 insertions(+), 53 deletions(-)
 delete mode 100644 AUTHORS
 create mode 100644 AUTHORS.in
 delete mode 100644 ChangeLog

diff --git a/.gitignore b/.gitignore
index 71d959c..44ec790 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
+ChangeLog
+AUTHORS
 *.[ao]
 *.l[ao]
 *~
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index 4e1d305..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1,29 +0,0 @@
-       libosinfo Authors
-       =================
-
-Current maintainers:
-
-  Zeeshan Ali (Khattak) <zeeshanak at gnome.org>
-  Daniel P. Berrange <berrange at redhat.com>
-
-Previous maintainers:
-
-  Arjun Roy <arroy at redhat.com>
-
-Patches contributed by:
-
-  Matthew Booth <mbooth at redhat.com>
-  Christophe Fergeau <cfergeau at redhat.com>
-  Jim Meyering <meyering at redhat.com>
-  Fabiano Fidêncio <fabiano at fidencio.org>
-  Wanlong Gao <gaowanlong at cn.fujitsu.com>
-  Michal Privoznik <mprivozn at redhat.com>
-  David Zeuthen <davidz at redhat.com>
-  Eric Blake <eblake at redhat.com>
-  Yuri Chornoivan <yurchor at ukr.net>
-  Marc-André Lureau <marcandre.lureau at redhat.com>
-  Cole Robinson <crobinso at redhat.com>
-  Andreas Henriksson <andreas at fatal.se>
-  ...send patches to get your name here...
-
--- End
diff --git a/AUTHORS.in b/AUTHORS.in
new file mode 100644
index 0000000..1f7ca5c
--- /dev/null
+++ b/AUTHORS.in
@@ -0,0 +1,19 @@
+       libosinfo Authors
+       =================
+
+Current maintainers:
+
+  Zeeshan Ali (Khattak) <zeeshanak at gnome.org>
+  Daniel P. Berrange <berrange at redhat.com>
+
+Previous maintainers:
+
+  Arjun Roy <arroy at redhat.com>
+
+Patches contributed by:
+
+#authorslist#
+
+  ...send patches to get your name here...
+
+-- End
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index 88fec90..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-0.01
-_______________________________________
-
-Initial codebase.
diff --git a/Makefile.am b/Makefile.am
index 566ccac..7bb5c32 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,6 +23,7 @@ EXTRA_DIST = \
   cfg.mk \
   GNUmakefile \
   maint.mk \
+  AUTHORS.in \
   $(INTLTOOL_FILES) \
   $(NULL)
 
@@ -59,16 +60,23 @@ cov: clean-cov
 clean-cov:
 	rm -rf $(top_builddir)/coverage
 
-dist-hook: gen-ChangeLog
+dist-hook: gen-ChangeLog gen-AUTHORS
 
 # Generate the ChangeLog file (with all entries since the switch to git)
 # and insert it into the directory we're about to use to create a tarball.
-gen_start_date = 2009-07-04
-.PHONY: gen-ChangeLog
+.PHONY: gen-ChangeLog gen-AUTHORS
 gen-ChangeLog:
 	if test -d .git; then					\
 	  $(top_srcdir)/build-aux/gitlog-to-changelog		\
-	    --since=$(gen_start_date) > $(distdir)/cl-t;	\
+	    > $(distdir)/cl-t;					\
 	  rm -f $(distdir)/ChangeLog;				\
 	  mv $(distdir)/cl-t $(distdir)/ChangeLog;		\
 	fi
+
+gen-AUTHORS:
+	$(AM_V_GEN)if test -d $(srcdir)/.git; then                      \
+	   out="`cd $(srcdir) && git log --pretty=format:'%aN <%aE>' | sort -u`" && \
+	  perl -p -e "s/#authorslist#// and print '$$out'"            \
+	     < $(srcdir)/AUTHORS.in > $(distdir)/AUTHORS-tmp &&        \
+	   mv -f $(distdir)/AUTHORS-tmp $(distdir)/AUTHORS ;           \
+	fi
diff --git a/autogen.sh b/autogen.sh
index b5997e6..c496d06 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -17,4 +17,9 @@ which gnome-autogen.sh || {
     exit 1
 }
 
+# Real ChangeLog/AUTHORS is auto-generated from GIT logs at
+# make dist time, but automake requires that it
+# exists at all times :-(
+touch ChangeLog AUTHORS
+
 ACLOCAL_FLAGS="$ACLOCAL_FLAGS" USE_GNOME2_MACROS=1 . gnome-autogen.sh --enable-gtk-doc "$@"
diff --git a/cfg.mk b/cfg.mk
index 0d3b2f9..36b000f 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -18,7 +18,6 @@
 # Tests not to run as part of "make distcheck".
 local-checks-to-skip =			\
   changelog-check			\
-  check-AUTHORS				\
   makefile-check			\
   makefile_path_separator_check		\
   patch-check				\
@@ -114,21 +113,6 @@ sc_copyright_format:
 # We don't use this feature of maint.mk.
 prev_version_file = /dev/null
 
-# 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_ at -]\)/\\\1/g'); \
-	  grep -iq "<$$sanitized>" $(srcdir)/AUTHORS			\
-	    || { printf '%s\n' "$$i" >&2; fail=1; };			\
-	done;								\
-	test $$fail = 1							\
-	  && echo '$(ME): committer(s) not listed in AUTHORS' >&2;	\
-	test $$fail = 0
-
-
 exclude_file_name_regexp--sc_bindtextdomain = ^(libvirt-gconfig/tests|examples)/
 
 exclude_file_name_regexp--sc_preprocessor_indentation = ^*/*.[ch]
-- 
1.8.1.4




More information about the Libosinfo mailing list