summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--.mailmap6
-rw-r--r--CONTRIBUTING.md9
-rwxr-xr-xautogen.sh5
-rwxr-xr-xmaint/autocontrib45
-rw-r--r--man/rcm.7.mustache (renamed from man/rcm.7)15
6 files changed, 68 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index f915ceb..c039fa7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,3 +28,6 @@ homebrew-formulae
release-arch
deb-build
rcm-*
+
+# Other generated files
+man/rcm.7
diff --git a/.mailmap b/.mailmap
new file mode 100644
index 0000000..68cc9bb
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,6 @@
+George Brocklehurst <george@thoughtbot.com> <george.brocklehurst@gmail.com>
+George Brocklehurst <george@thoughtbot.com> <george@georgebrock.com>
+Javier López <linux.kitten@gmail.com> <kitten@openbsdbox>
+Mike Burns <mburns@thoughtbot.com> <mike@mike-burns.com>
+Pablo Olmos de Aguilera Corradini <pablo@glatelier.org>
+Patrick Brisbin <pat@thoughtbot.com> <pbrisbin@gmail.com>
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 62509ea..fcf9da1 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -6,7 +6,7 @@ Overview
- We do not currently have a test suite.
- Update `NEWS.md.in`.
-- Update `rcm.7`.
+- Update `.mailmap`.
- Submit a pull request on GitHub.
Explanation
@@ -21,8 +21,11 @@ release. Bugfixes should be marked with `BUGFIX`. Small things (typos,
code style) should be grouped but with multiple authors (`Documentation
updates thanks to Dan Croak and Roberto Pedroso`).
-Ensure your name is in the list of contributors in `man/rcm.7`. These
-are alphabetical.
+We use your name and email address as produced by `git-shortlog(1)`. You
+can change how this is formatted by modifying `.mailmap`. More details
+on that file can be found in the git [Documentation/mailmap.txt][mailmap].
Submit a pull request using GitHub. If there is a relevant bug, mention
it in the commit message (`Fixes #42.`).
+
+[mailmap]: https://github.com/git/git/blob/6a907786af835ac15962be53f1492f2
diff --git a/autogen.sh b/autogen.sh
index 248f54a..f8969de 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,3 +1,6 @@
#!/bin/sh
-aclocal && autoconf && automake --add-missing --copy
+aclocal &&
+ autoconf &&
+ automake --add-missing --copy &&
+ ./maint/autocontrib man/rcm.7.mustache
diff --git a/maint/autocontrib b/maint/autocontrib
new file mode 100755
index 0000000..f0eaf66
--- /dev/null
+++ b/maint/autocontrib
@@ -0,0 +1,45 @@
+#!/usr/bin/env ruby
+
+begin
+ require 'mustache'
+rescue LoadError
+ $stderr.puts <<-HERE
+Error: This project requires the mustache Ruby gem in order to finish
+the maintainer setup. Please install it and re-run autocontrib.
+
+The mustache gem can be installed using gem:
+
+ gem install mustache
+ HERE
+ exit 1
+end
+
+class ContributorView < Mustache
+ def contributors
+ @_contributors ||= raw_contributors
+ end
+
+ private
+
+ def raw_contributors
+ shortlog.map do |contributor_line|
+ if contributor_line =~ /\d+\s+(.+)\s+<(.+)>/
+ { :name => $1, :email => $2 }
+ end
+ end.compact
+ end
+
+ def shortlog
+ `git shortlog -es`.split("\n")
+ end
+end
+
+
+contributor_view = ContributorView.new
+
+ARGV.each do |template_filename|
+ output_filename = template_filename.sub(/\.mustache$/, '')
+ contributor_view.template_file = template_filename
+ output = contributor_view.render
+ File.write(output_filename, output)
+end
diff --git a/man/rcm.7 b/man/rcm.7.mustache
index 71b99f4..8956e5d 100644
--- a/man/rcm.7
+++ b/man/rcm.7.mustache
@@ -239,15 +239,8 @@ is maintained by
.An "Mike Burns" Aq Mt mburns@thoughtbot.com
and
.Lk http://thoughtbot.se thoughtbot
-.Sh CONTIRBUTORS
+.Sh CONTRIBUTORS
.An -split
-.An "Anton Ilin" Aq Mt anton@ilin.dn.ua
-.An "Caleb Land" Aq Mt caleb@land.fm
-.An "Dan Croak" Aq Mt dan@thoughtbot.com
-.An "Daniel Watson" Aq Mt dbwatson@vectorspace.org
-.An "George Brocklehurst" Aq Mt george@thoughtbot.com
-.An "Javier López" Aq Mt linux.kitten@gmail.com
-.An "Jordan Eldredge" Aq Mt jordaneldredge@gmail.com
-.An "Pablo Olmos de Aguilera Corradini" Aq Mt pablo@glatelier.org
-.An "Patrick Brisbin" Aq Mt pat@thoughtbot.com
-.An "Roberto Pedroso" Aq Mt roberto@rpedroso.com
+{{#contributors}}
+.An "{{{name}}}" Aq Mt {{{email}}}
+{{/contributors}}