From ce6b1d0951bd470d03a29095c3f97e39d7e0e8fd Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Sat, 19 Oct 2013 14:20:54 +0200 Subject: [PATCH] Contrib script now shows PRs and merges. --- doc/release/{contributors.py => contribs.py} | 21 ++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) rename doc/release/{contributors.py => contribs.py} (53%) diff --git a/doc/release/contributors.py b/doc/release/contribs.py similarity index 53% rename from doc/release/contributors.py rename to doc/release/contribs.py index 82c3e1f0..08a59fc9 100755 --- a/doc/release/contributors.py +++ b/doc/release/contribs.py @@ -13,10 +13,27 @@ tag = sys.argv[1] def call(cmd): return subprocess.check_output(shlex.split(cmd)).split('\n') - tag_date = call("git show --format='%%ci' %s" % tag)[0] print "Release %s was on %s" % (tag, tag_date) -print "\nCommitters since, alphabetical by last name:\n" + +merges = call("git log --since='%s' --merges --format='>>>%%B' --reverse" % tag_date) +merges = [m for m in merges if m.strip()] +merges = '\n'.join(merges).split('>>>') +merges = [m.split('\n')[:2] for m in merges] +merges = [m for m in merges if len(m) == 2 and m[1].strip()] + +print "\nIt contained the following %d merges:" % len(merges) +print +for (merge, message) in merges: + if merge.startswith('Merge pull request #'): + PR = ' (%s)' % merge.split()[3] + else: + PR = '' + + print '- ' + message + PR + + +print "\nMade by the following committers [alphabetical by last name]:\n" authors = call("git log --since='%s' --format=%%aN" % tag_date) authors = [a.strip() for a in authors if a.strip()]