| 54 | |
| 55 | |
| 56 | def get_authors(revision_range): |
| 57 | lst_release, cur_release = [r.strip() for r in revision_range.split('..')] |
| 58 | authors_pat = r'^.*\t(.*)$' |
| 59 | |
| 60 | # authors and co-authors in current and previous releases. |
| 61 | grp1 = '--group=author' |
| 62 | grp2 = '--group=trailer:co-authored-by' |
| 63 | cur = this_repo.git.shortlog('-s', grp1, grp2, revision_range) |
| 64 | pre = this_repo.git.shortlog('-s', grp1, grp2, lst_release) |
| 65 | authors_cur = set(re.findall(authors_pat, cur, re.M)) |
| 66 | authors_pre = set(re.findall(authors_pat, pre, re.M)) |
| 67 | |
| 68 | # Ignore the bot Homu. |
| 69 | authors_cur.discard('Homu') |
| 70 | authors_pre.discard('Homu') |
| 71 | |
| 72 | # Ignore the bot dependabot-preview |
| 73 | authors_cur.discard('dependabot-preview') |
| 74 | authors_pre.discard('dependabot-preview') |
| 75 | |
| 76 | # Append '+' to new authors. |
| 77 | authors_new = [s + ' +' for s in authors_cur - authors_pre] |
| 78 | authors_old = list(authors_cur & authors_pre) |
| 79 | authors = authors_new + authors_old |
| 80 | authors.sort() |
| 81 | return authors |
| 82 | |
| 83 | |
| 84 | def get_pull_requests(repo, revision_range): |