diff options
author | Bhuvan Arumugam <bhuvan@apache.org> | 2012-04-12 09:05:11 -0700 |
---|---|---|
committer | Monty Taylor <mordred@inaugust.com> | 2012-04-12 09:14:26 -0700 |
commit | 0417e9f0ca13d36a8e6d03e539e5a93a8e9c9eab (patch) | |
tree | 2b98d83d1193461fb17dbce76fec1aa859f59095 /setup.py | |
parent | ad006f4dce7ddd98ea2c06afc73516c3713354bc (diff) | |
download | pbr-0417e9f0ca13d36a8e6d03e539e5a93a8e9c9eab.tar.gz |
Add AUTHORS generation function.
Change-Id: I0adbf0755a0191c7b68af9ca2f6e50c787ee7043
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -118,10 +118,23 @@ version_info = { def write_git_changelog(): - """ Write a changelog based on the git changelog """ + """Write a changelog based on the git changelog""" if os.path.isdir('.git'): git_log_cmd = 'git log --stat' changelog = _run_shell_command(git_log_cmd) mailmap = parse_mailmap() with open("ChangeLog", "w") as changelog_file: changelog_file.write(canonicalize_emails(changelog, mailmap)) + + +def generate_authors(): + """Create AUTHORS file using git commits""" + jenkins_email = 'jenkins@review.openstack.org' + if os.path.isdir('.git'): + # don't include jenkins email address in AUTHORS file + git_log_cmd = "git log --format='%aN <%aE>' | sort -u | " \ + "grep -v " + jenkins_email + changelog = _run_shell_command(git_log_cmd) + mailmap = parse_mailmap() + with open("AUTHORS", "w") as authors_file: + authors_file.write(canonicalize_emails(changelog, mailmap)) |