git-mr-comment-list: allow limit comments by recipients
authorFrantisek Hrbata <frantisek@hrbata.com>
Sat, 19 Dec 2020 12:38:05 +0000 (13:38 +0100)
committerFrantisek Hrbata <frantisek@hrbata.com>
Sat, 19 Dec 2020 12:38:05 +0000 (13:38 +0100)
Signed-off-by: Frantisek Hrbata <frantisek@hrbata.com>
git-mr-comment-list

index 7d86daa28550f277324ad342e72c59f0de0287fa..1855e7f4342a52d32f9627effb0f6309075986e8 100755 (executable)
@@ -47,6 +47,8 @@ parser.add_argument("--before", metavar="DATE",
         help="Limit the comments output to ones older than a specific date.")
 parser.add_argument("--author", metavar="PATTERN", action="append",
         help="Limit the comments output to ones that were created by user matching PATTERN. Can be used multiple times.")
+parser.add_argument("--to", metavar="PATTERN", action="append",
+        help="Limit the comments output to ones that were addressed to user matching PATTERN. Can be used multiple times.")
 
 class CFormatter(string.Formatter):
     def __init__(self):
@@ -119,6 +121,10 @@ if args.author:
     for pattern in args.author:
         cmd += ["--author", pattern]
 
+if args.to:
+    for pattern in args.to:
+        cmd += ["--grep", "^To: .*" + pattern]
+
 if args.extended_regexp:
     cmd += ["--extended-regexp"]