git-mr-merge: add --edit option
authorFrantisek Hrbata <frantisek@hrbata.com>
Fri, 18 Dec 2020 14:43:59 +0000 (15:43 +0100)
committerFrantisek Hrbata <frantisek@hrbata.com>
Fri, 18 Dec 2020 14:43:59 +0000 (15:43 +0100)
Signed-off-by: Frantisek Hrbata <frantisek@hrbata.com>
git-mr-merge

index 04bd4511cf516e93c70ff1de2bfa5243b95f7dd9..5de79dc7f0b03f627fcc79fcc41cfd11fb0a17a1 100755 (executable)
@@ -23,6 +23,8 @@ parser.add_argument("-f", "--force", action="store_true",
         help="Proceed with the merge even if the MR base does not match.")
 parser.add_argument("--ff", action="store_true",
         help="Allow fast-forward. By default merge commit is created even for fast-forward merges.")
+parser.add_argument("-e", "--edit", action="store_true",
+        help="Invoke an editor before committing successful mechanical merge.")
 
 args = parser.parse_args()
 refs = mrlib.load_refs()
@@ -55,9 +57,8 @@ if args.ff:
 else:
     cmd += ["--no-ff"]
 
+if args.edit:
+    cmd += ["--edit"]
+
 cmd += [mr]
-rv, out, err = mrlib.run(cmd)
-if out:
-    print(out, end="")
-if err:
-    print(err, file=sys.stderr, end="")
+rv, out, err = mrlib.run(cmd, stdout=False, stderr=False)