diff mbox series

shazam: Don't use "git merge --edit" when non-interactive

Message ID 20221013181031.23823-1-palmer@rivosinc.com (mailing list archive)
State Accepted
Headers show
Series shazam: Don't use "git merge --edit" when non-interactive | expand

Commit Message

Palmer Dabbelt Oct. 13, 2022, 6:10 p.m. UTC
Most text editors are interactive, so call "git merge --no-edit" when in
b4's non-interactive mode.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
 b4/mbox.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Konstantin Ryabitsev Oct. 18, 2022, 3:31 p.m. UTC | #1
On Thu, 13 Oct 2022 11:10:31 -0700, Palmer Dabbelt wrote:
> Most text editors are interactive, so call "git merge --no-edit" when in
> b4's non-interactive mode.
> 
> 

Applied, thanks!

[1/1] shazam: Don't use "git merge --edit" when non-interactive
      commit: ce3c3dfae4bae26175a92e1723e63cda0fcc5154

Best regards,
diff mbox series

Patch

diff --git a/b4/mbox.py b/b4/mbox.py
index ff96a11..59073be 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -374,7 +374,12 @@  def make_am(msgs, cmdargs, msgid):
         mergeflags = config.get('shazam-merge-flags', '--signoff')
         sp = shlex.shlex(mergeflags, posix=True)
         sp.whitespace_split = True
-        mergeargs = ['merge', '--no-ff', '-F', mmf, '--edit', 'FETCH_HEAD'] + list(sp)
+        edit = None
+        if cmdargs.no_interactive:
+            edit = '--no-edit'
+        else:
+            edit = '--edit'
+        mergeargs = ['merge', '--no-ff', '-F', mmf, edit, 'FETCH_HEAD'] + list(sp)
         mergecmd = ['git'] + mergeargs
 
         thanks_record_am(lser, cherrypick=cherrypick)