diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2021-09-29 16:11:21 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2021-09-29 16:11:21 -0400 |
commit | bd64dab483f6302bbdd792c5e678c0ab51060cbe (patch) | |
tree | c2f51cf1b1319483e155fa164c955d6153133932 | |
parent | 75e4e8102fd21760be2cf9bbe8301a8a33934b5a (diff) | |
download | b4-bd64dab483f6302bbdd792c5e678c0ab51060cbe.tar.gz |
shazam: allow configuring "git am" flags
Setting b4.git-am-flags should allow you to specify what additional
flags to pass to "git am" before shazaming a bunch of patches on to the
current branch. Example entry in ~/.gitconfig
[b4]
git-am-flags = -s
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/mbox.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -19,6 +19,7 @@ import shutil import pathlib import tempfile import io +import shlex import urllib.parse import xml.etree.ElementTree @@ -252,8 +253,11 @@ def make_am(msgs, cmdargs, msgid): b4.save_git_am_mbox(am_msgs, ifh) ambytes = ifh.getvalue().encode() if cmdargs.applyhere: - # Blindly attempt to apply to the current tree - ecode, out = b4.git_run_command(topdir, ['am'], stdin=ambytes, logstderr=True) + amflags = config.get('git-am-flags', '') + sp = shlex.shlex(amflags, posix=True) + sp.whitespace_split = True + amargs = list(sp) + ecode, out = b4.git_run_command(topdir, ['am'] + amargs, stdin=ambytes, logstderr=True) logger.info(out.strip()) if ecode == 0: thanks_record_am(lser, cherrypick=cherrypick) |