git-mr-comment-list: allow limit comments by date
authorFrantisek Hrbata <frantisek@hrbata.com>
Sat, 19 Dec 2020 11:52:05 +0000 (12:52 +0100)
committerFrantisek Hrbata <frantisek@hrbata.com>
Sat, 19 Dec 2020 11:56:48 +0000 (12:56 +0100)
This just adds wrapper around git-log --before and --after options.

Signed-off-by: Frantisek Hrbata <frantisek@hrbata.com>
git-mr-comment-list

index b4aa1c8f77769c7dc8a71c6696d90678313f5bcb..b672d156e85794533f11fa70d01435f3c49ed94a 100755 (executable)
@@ -39,6 +39,10 @@ parser.add_argument("-r", "--read-revs", metavar="FILE",
         help="Read revs for previously read comments from FILE (default: $HOME/.gimrr/comment.revs).")
 parser.add_argument("-n", "--new-only", action="store_true",
         help="List only new comments.")
+parser.add_argument("--after", metavar="DATE",
+        help="Limit the comments output to ones more recent than a specific date.")
+parser.add_argument("--before", metavar="DATE",
+        help="Limit the comments output to ones older than a specific date.")
 
 class CFormatter(string.Formatter):
     def __init__(self):
@@ -101,6 +105,12 @@ if args.all_match:
 if args.regexp_ignore_case:
     cmd += ["--regexp-ignore-case"]
 
+if args.after:
+    cmd += ["--after", args.after]
+
+if args.before:
+    cmd += ["--before", args.before]
+
 rv, out, err = mrlib.run(cmd, stdin=stdin)
 
 c2m = mrlib.comments2mrs(refs, mrs)