summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2021-05-09 18:00:10 -0600
committerCharles Harris <charlesr.harris@gmail.com>2021-05-09 18:00:10 -0600
commitd5134ae507d49970b5212596c1d603746b806b6d (patch)
treeb8f6c8269b71fc3f357bca9d87673502fb04c959
parent38bdff05da0859f45bebf5a0c32869d58365b02f (diff)
downloadnumpy-d5134ae507d49970b5212596c1d603746b806b6d.tar.gz
ENH: Include co-authors in changelog.
Closes #18969
-rwxr-xr-xtools/changelog.py29
1 files changed, 19 insertions, 10 deletions
diff --git a/tools/changelog.py b/tools/changelog.py
index 9da330500..1f116cc20 100755
--- a/tools/changelog.py
+++ b/tools/changelog.py
@@ -57,25 +57,34 @@ A total of %d pull requests were merged for this release.
def get_authors(revision_range):
- pat = u'^.*\\t(.*)$'
lst_release, cur_release = [r.strip() for r in revision_range.split('..')]
+ authors_pat = u'^.*\\t(.*)$'
# authors, in current release and previous to current release.
- cur = set(re.findall(pat, this_repo.git.shortlog('-s', revision_range),
- re.M))
- pre = set(re.findall(pat, this_repo.git.shortlog('-s', lst_release),
- re.M))
+ cur = this_repo.git.shortlog('-s', revision_range)
+ pre = this_repo.git.shortlog('-s', lst_release)
+ authors_cur = set(re.findall(authors_pat, cur, re.M))
+ authors_pre = set(re.findall(authors_pat, pre, re.M))
+
+ # include co-authors
+ grp = '--group=trailer:co-authored-by'
+ cur = this_repo.git.shortlog('-s', grp, revision_range)
+ pre = this_repo.git.shortlog('-s', grp, lst_release)
+ authors_cur |= set(re.findall(authors_pat, cur, re.M))
+ authors_pre |= set(re.findall(authors_pat, pre, re.M))
# Ignore the bot Homu.
- cur.discard('Homu')
- pre.discard('Homu')
+ authors_cur.discard('Homu')
+ authors_pre.discard('Homu')
# Ignore the bot dependabot-preview
- cur.discard('dependabot-preview')
- pre.discard('dependabot-preview')
+ authors_cur.discard('dependabot-preview')
+ authors_pre.discard('dependabot-preview')
# Append '+' to new authors.
- authors = [s + u' +' for s in cur - pre] + [s for s in cur & pre]
+ authors_new = [s + u' +' for s in authors_cur - authors_pre]
+ authors_old = [s for s in authors_cur & authors_pre]
+ authors = authors_new + authors_old
authors.sort()
return authors