[openssl-commits] [tools] master update

Richard Levitte levitte at openssl.org
Thu Nov 15 23:54:01 UTC 2018


The branch master has been updated
       via  e759eccf4e6bd38f8a16e8ee053b1da978d4fb89 (commit)
      from  ca2469ca133476e1fb3f89bbaf43f8d7a4244c25 (commit)


- Log -----------------------------------------------------------------
commit e759eccf4e6bd38f8a16e8ee053b1da978d4fb89
Author: Dr. Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
Date:   Wed Oct 24 08:53:38 2018 +0200

    cherry-checker: add a 'fixes' column
    
    Scans the commit messages for 'Fixes' annotations and displays
    them in an additional column.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/tools/pull/33)

-----------------------------------------------------------------------

Summary of changes:
 review-tools/cherry-checker | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/review-tools/cherry-checker b/review-tools/cherry-checker
index d65e801..dbdbd06 100755
--- a/review-tools/cherry-checker
+++ b/review-tools/cherry-checker
@@ -76,13 +76,16 @@ def pick_cherries(left, right, all = False):
         left + "..." + right, "--pretty=%at;%m;%h;%s"
     ]
 
-    regex   = re.compile("|".join([
+    prnum_regex   = re.compile("|".join([
         # The standard pull request annotation
         "\(Merged from https://github.com/openssl/openssl/pull/([0-9]+)\)",
         # @kroeck's special pull request annotation ;-)
         "GH: #([0-9]+)"
     ]))
 
+    fixes_regex   = re.compile(
+        "Fixes[:]?\s+(#|https://github.com/openssl/openssl/pull/)([0-9]+)")
+
     for line in subprocess.check_output(git_command).decode().splitlines():
 
         timestamp, branch, commit, subject = line.split(";")
@@ -99,7 +102,7 @@ def pick_cherries(left, right, all = False):
             ["git", "show", "--no-patch", commit]
         ).decode()
 
-        match = regex.search(message)
+        match = prnum_regex.search(message)
         if match:
             if match.group(1):
                 prnum = match.group(1)
@@ -108,7 +111,13 @@ def pick_cherries(left, right, all = False):
         else:
             prnum = "????"
 
-        yield prnum, timestamp, branch, commit, subject
+        match = fixes_regex.search(message)
+        if match:
+            fixes = "#" + match.group(2)
+        else:
+            fixes = ""
+
+        yield prnum, fixes, timestamp, branch, commit, subject
 
 
 
@@ -136,17 +145,17 @@ if __name__ == '__main__':
   ->  {right}
   ==  both
 
- prnum | br |   commit   |   subject
- ----- | -- | ---------- | -------------------------------------------""".format(
+ prnum | fixes | br |   commit   |   subject
+ ----- | ----- | -- | ---------- | -------------------------------------------""".format(
          left = left,
          right = right))
 
     branch_marker = { '<': '<-', '>': '->', '=' : '==' }
 
     try:
-        for prnum, _, branch, commit, subject in commits:
-            print(' #{:>4} | {} | {} | {} '.format(
-                prnum, branch_marker[branch], commit, subject
+        for prnum, fixes, _, branch, commit, subject in commits:
+            print(' #{:>4} | {:>5} | {} | {} | {} '.format(
+                prnum, fixes, branch_marker[branch], commit, subject
             ))
     except subprocess.CalledProcessError as e:
         print(e, file=sys.stderr)


More information about the openssl-commits mailing list