aboutsummaryrefslogtreecommitdiff
path: root/b4/__init__.py
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-12-14 13:58:42 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-12-14 13:58:42 -0500
commitb860e96fe695b73fde356da72ec70172189fbff7 (patch)
treeec8edfa132f2c5eeff41379213ea5bf63b130fd7 /b4/__init__.py
parent4e396d2091fe70d2217865a1836695e00b5067f2 (diff)
downloadb4-b860e96fe695b73fde356da72ec70172189fbff7.tar.gz
Allow passing extra opts to git-format-patch
We probably want to be able to tweak the output of git-format-patch based on which list we're running it for (e.g. passing --minimal or --histogram), so make it possible to pass extra parameters to the git command. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/__init__.py')
-rw-r--r--b4/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index 432a8cd..e936781 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -2335,11 +2335,13 @@ def get_pi_thread_by_msgid(msgid, savefile, useproject=None, nocache=False):
@contextmanager
-def git_format_patches(gitdir, start, end, prefixes=None):
+def git_format_patches(gitdir, start, end, prefixes=None, extraopts=None):
with TemporaryDirectory() as tmpd:
gitargs = ['format-patch', '--cover-letter', '-o', tmpd, '--signature', f'b4 {__VERSION__}']
if prefixes is not None and len(prefixes):
gitargs += ['--subject-prefix', ' '.join(prefixes)]
+ if extraopts:
+ gitargs += extraopts
gitargs += ['%s..%s' % (start, end)]
ecode, out = git_run_command(gitdir, gitargs)
if ecode > 0: