bin/update_authors.py: add authors from Co-authored-by: lines too

This commit is contained in:
Nick Craig-Wood 2023-11-16 16:55:48 +00:00
parent e1b0417c28
commit cdf5a97bb6
3 changed files with 27 additions and 0 deletions

View File

@ -9,3 +9,4 @@
<ricci@disroot.org>
<stoesser@yay-digital.de>
<services+github@simjo.st>
<seb•ɑƬ•chezwam•ɖɵʈ•org>

View File

@ -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")
@ -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()

View File

@ -787,3 +787,10 @@ put them back in again.` >}}
* wuxingzhong <qq330332812@gmail.com>
* Adithya Kumar <akumar42@protonmail.com>
* Tayo-pasedaRJ <138471223+Tayo-pasedaRJ@users.noreply.github.com>
* Peter Kreuser <logo@kreuser.name>
* Piyush <piyushgarg80>
* fotile96 <fotile96@users.noreply.github.com>
* Luc Ritchie <luc.ritchie@gmail.com>
* cynful <cynful@users.noreply.github.com>
* wjielai <wjielai@tencent.com>
* Jack Deng <jackdeng@gmail.com>