Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for authorlist

This makes it possible to enforce both the committer name and the author name,
while not enforcing them to actually be the same. Meaning one committer
can commit a patch authored by another one.

As asked for by Peter E.
  • Loading branch information...
commit df4138f833b3471d9eb32966cb356fe5081d12f5 1 parent 6da709c
@mhagander authored
Showing with 23 additions and 13 deletions.
  1. +6 −0 README.rst
  2. +17 −13
6 README.rst
@@ -120,6 +120,12 @@ committerlist
config file. This ensures that committers don't accidentally use a
badly configured client. All the commiters should be listed in the
[committers] section, in the format User Name=email.
+ Enforce that the username and email of the author is listed in the
+ config file. It uses the same list of users as the committerlist,
+ thus it should be listed in [committers]. This allows one committer
+ to push things made by another committer, while still making sure
+ all authors are registered.
Enforce that there are no lightweight tags - only tags carrying
a description are allowed.
@@ -8,7 +8,7 @@
# Note: the script (not surprisingly) uses the git commands in pipes, so git
# needs to be available in the path.
-# Copyright (C) 2010-2011 PostgreSQL Global Development Group
+# Copyright (C) 2010-2013 PostgreSQL Global Development Group
# Author: Magnus Hagander <>
# Released under the PostgreSQL license
@@ -149,19 +149,23 @@ def check_policies(self):
if self._enforce("committerlist"):
# Enforce specific committer listed in config file.
- # We do this by splitting the name again, and doing a lookup
- # match on that.
- m ='^([a-zA-Z0-9. ]+) <([^>]+)>', self.committer)
- if not m:
- raise Exception("Committer '%s' for commit %s does not follow format rules." % (self.committer, self.commitid))
- if not c.has_option('committers',
- self._policyfail("Committer %s not listed in committers section" %
- if not c.get('committers', ==
- self._policyfail("Committer %s has wrong email (%s, should be %s)" % (
-,, c.get('committers',
- # Currently no policy for "authorlist" - expect committerequalsauthor+committerlist to be
- # used in those cases.
+ self.enforce_user(self.committer, 'Committer')
+ if self._enforce("authorlist"):
+ # Enforce specific author is listed in config file (as committer).
+ self.enforce_user(, 'Author')
+ def enforce_user(self, user, usertype):
+ # We do this by splitting the name again, and doing a lookup
+ # match on that.
+ m ='^([a-zA-Z0-9. ]+) <([^>]+)>', user)
+ if not m:
+ raise Exception("%s '%s' for commit %s does not follow format rules." % (usertype, user, self.commitid))
+ if not c.has_option('committers',
+ self._policyfail("%s %s not listed in committers section" % (usertype,
+ if not c.get('committers', ==
+ self._policyfail("%s %s has wrong email (%s, should be %s)" % (
+ usertype,,, c.get('committers',
class Tag(PolicyObject):
def __init__(self, ref, name):
Please sign in to comment.
Something went wrong with that request. Please try again.