From 9e55abe2a8bdb09aff2fff0102f2a2dd4e99ebbc Mon Sep 17 00:00:00 2001 From: Bhuvan Arumugam Date: Thu, 12 Apr 2012 09:05:11 -0700 Subject: Add AUTHORS generation function. Change-Id: I0adbf0755a0191c7b68af9ca2f6e50c787ee7043 --- openstack/common/setup.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'openstack/common') diff --git a/openstack/common/setup.py b/openstack/common/setup.py index 9eabfcc..4376102 100644 --- a/openstack/common/setup.py +++ b/openstack/common/setup.py @@ -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)) -- cgit