[llvm] Github Automation: Add support for an optional colon after command name (PR #66540)

Pranav Reddy P via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 15 12:29:26 PDT 2023


https://github.com/PranavReddyP16 created https://github.com/llvm/llvm-project/pull/66540

As requested in https://github.com/llvm/llvm-project/issues/64803

example -> /cherry-pick: or /branch:

>From 56810eb2573f8952e949d5411f75b6377e7673ec Mon Sep 17 00:00:00 2001
From: PranavReddyP16 <pranavreddyp16 at gmail.com>
Date: Sat, 16 Sep 2023 00:48:55 +0530
Subject: [PATCH] Changed regex to match with an optional colon after command
 name in execute_command function (example -> /cherry-pick:)

---
 llvm/utils/git/github-automation.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/utils/git/github-automation.py b/llvm/utils/git/github-automation.py
index eac5816b5499f6a..090359b8822a73a 100755
--- a/llvm/utils/git/github-automation.py
+++ b/llvm/utils/git/github-automation.py
@@ -572,12 +572,12 @@ def execute_command(self) -> bool:
         """
         This function reads lines from STDIN and executes the first command
         that it finds.  The 2 supported commands are:
-        /cherry-pick commit0 <commit1> <commit2> <...>
-        /branch <owner>/<repo>/<branch>
+        /cherry-pick<:> commit0 <commit1> <commit2> <...>
+        /branch<:> <owner>/<repo>/<branch>
         """
         for line in sys.stdin:
             line.rstrip()
-            m = re.search(r"/([a-z-]+)\s(.+)", line)
+            m = re.search(r"/([a-z-]+)(?::)?\s(.+)", line)
             if not m:
                 continue
             command = m.group(1)



More information about the llvm-commits mailing list