Skip to content

Commit

Permalink
bin/update_authors.py: add authors from Co-authored-by: lines too
Browse files Browse the repository at this point in the history
  • Loading branch information
ncw committed Nov 16, 2023
1 parent e1b0417 commit cdf5a97
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/.ignore-emails
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
<[email protected]>
<[email protected]>
<[email protected]>
<seb•ɑƬ•chezwam•ɖɵʈ•org>
19 changes: 19 additions & 0 deletions bin/update-authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def add_email(name, email):
subprocess.check_call(["git", "commit", "-m", "Add %s to contributors" % name, AUTHORS])

def main():
# Add emails from authors
out = subprocess.check_output(["git", "log", '--reverse', '--format=%an|%ae', "master"])
out = out.decode("utf-8")

Expand All @@ -43,5 +44,23 @@ def main():
previous.add(email)
add_email(name, email)

# Add emails from Co-authored-by: lines
out = subprocess.check_output(["git", "log", '-i', '--grep', 'Co-authored-by:', "master"])
out = out.decode("utf-8")
co_authored_by = re.compile(r"(?i)Co-authored-by:\s+(.*?)\s+<([^>]+)>$")

for line in out.split("\n"):
line = line.strip()
m = co_authored_by.search(line)
if not m:
continue
name, email = m.group(1), m.group(2)
name = name.strip()
email = email.strip()
if email in previous:
continue
previous.add(email)
add_email(name, email)

if __name__ == "__main__":
main()
7 changes: 7 additions & 0 deletions docs/content/authors.md
Original file line number Diff line number Diff line change
Expand Up @@ -787,3 +787,10 @@ put them back in again.` >}}
* wuxingzhong <[email protected]>
* Adithya Kumar <[email protected]>
* Tayo-pasedaRJ <[email protected]>
* Peter Kreuser <[email protected]>
* Piyush <piyushgarg80>
* fotile96 <[email protected]>
* Luc Ritchie <[email protected]>
* cynful <[email protected]>
* wjielai <[email protected]>
* Jack Deng <[email protected]>

0 comments on commit cdf5a97

Please sign in to comment.