From cdf5a97bb617bcca764501890e57dbae732c0a92 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 16 Nov 2023 16:55:48 +0000 Subject: [PATCH] bin/update_authors.py: add authors from Co-authored-by: lines too --- bin/.ignore-emails | 1 + bin/update-authors.py | 19 +++++++++++++++++++ docs/content/authors.md | 7 +++++++ 3 files changed, 27 insertions(+) diff --git a/bin/.ignore-emails b/bin/.ignore-emails index e1f26fe3d..14cbc62fc 100644 --- a/bin/.ignore-emails +++ b/bin/.ignore-emails @@ -9,3 +9,4 @@ + diff --git a/bin/update-authors.py b/bin/update-authors.py index effedb091..b422c16a6 100755 --- a/bin/update-authors.py +++ b/bin/update-authors.py @@ -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() diff --git a/docs/content/authors.md b/docs/content/authors.md index 97e3d4197..07ca6d3e0 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -787,3 +787,10 @@ put them back in again.` >}} * wuxingzhong * Adithya Kumar * Tayo-pasedaRJ <138471223+Tayo-pasedaRJ@users.noreply.github.com> + * Peter Kreuser + * Piyush + * fotile96 + * Luc Ritchie + * cynful + * wjielai + * Jack Deng