This is an automated email from the ASF dual-hosted git repository.

chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new fdee225a1be KAFKA-17177 reviewers.py should grep "authors" to offer 
more candidates of reviewers information (#16674)
fdee225a1be is described below

commit fdee225a1be1c7d9986c39d9148ec801628e943a
Author: Chia Chuan Yu <[email protected]>
AuthorDate: Mon Jul 29 18:36:35 2024 +0800

    KAFKA-17177 reviewers.py should grep "authors" to offer more candidates of 
reviewers information (#16674)
    
    Reviewers: Chia-Ping Tsai <[email protected]>
---
 reviewers.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/reviewers.py b/reviewers.py
index e06aa2edbbc..ccac5e3182c 100755
--- a/reviewers.py
+++ b/reviewers.py
@@ -38,18 +38,20 @@ def prompt_for_user():
 if __name__ == "__main__":
     print("Utility to help generate 'Reviewers' string for Pull Requests. Use 
Ctrl+D or Ctrl+C to exit")
 
-    stream = os.popen("git log | grep Reviewers")
+    command = r"git log | grep 'Reviewers\|Author'"
+    stream = os.popen(command)
     lines = stream.readlines()
     all_reviewers = defaultdict(int)
     for line in lines:
-        stripped = line.strip().lstrip("Reviewers: ")
+        stripped = line.strip().lstrip("Reviewers: ").lstrip("Author: ")
         reviewers = stripped.split(",")
         for reviewer in reviewers:
             all_reviewers[reviewer.strip()] += 1
     parsed_reviewers = []
 
     for item in all_reviewers.items():
-        m = re.match("(?P<name>.*)\s<(?P<email>.*)>", item[0])
+        patterns = r"(?P<name>.*)\s<(?P<email>.*)>"
+        m = re.match(patterns, item[0])
         if m is not None and len(m.groups()) == 2:
             if item[1] > 2:
                 parsed_reviewers.append((m.group("name"), m.group("email"), 
item[1]))

Reply via email to