diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2021-06-08 10:57:05 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2021-06-08 10:57:05 -0400 |
commit | 1ac98d05d1a665f4376e3652163b9f3c17b6f808 (patch) | |
tree | e96d6cea41a2bacc1deccb548c270ba09dcc10c4 /b4/command.py | |
parent | c2e1aa9cbbf3d89aef501a23befa3dd59e0309dc (diff) | |
download | b4-1ac98d05d1a665f4376e3652163b9f3c17b6f808.tar.gz |
Tentative suport for sending exploded series
I've been working on a way to automatically convert pull requests into
series, complete with mailing them out to arbitrary destinations. This
would allow folks to send a pull request to a dedicated list and have it
automatically converted into a well-formed series.
This is a tentative implementation that relies on git-send-email to do
most of the heavy lifting. I have misgivings about using git-send-email
for this purpose, but it does reduce the amount of duplicated code we
would have otherwise had to write, and allows us to hook into things
like tocmd/cccmd, etc.
For example, adding the following to your .git/config:
[sendemail "autopr"]
smtpserver = [your.server.here]
smtpserverport = 587
smtpencryption = tls
smtpuser = [your-user]
smtppass = [your-pass]
transferEncoding = 8bit
suppressFrom = yes
confirm = never
validate = no
tocmd = "$(git rev-parse --show-toplevel)/scripts/get_maintainer.pl --norolestats --nol"
cccmd = "$(git rev-parse --show-toplevel)/scripts/get_maintainer.pl --norolestats --nom"
This would allow doing the following:
b4 pr -e -f "AutoPR Exploder <autopr@yourdomain.here>" -s autopr [--dry-run]
The pull request will be exploded into a patch series and sent to all
the proper destinations as returned by get_maintainer.pl. We construct
the message headers in a way that allow regular code review and "b4 am"
usage after the auto-exploded series is sent out.
If testing goes well, we'll implement this as a kernel.org service and
then hook a similar implementation via Gitlab/Github.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/command.py')
-rw-r--r-- | b4/command.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/b4/command.py b/b4/command.py index 3f130c8..2d6994d 100644 --- a/b4/command.py +++ b/b4/command.py @@ -160,6 +160,11 @@ def cmd(): help='Attempt to retrieve any Link: URLs (use with -e)') sp_pr.add_argument('-f', '--from-addr', dest='mailfrom', default=None, help='Use this From: in exploded messages (use with -e)') + sp_pr.add_argument('-s', '--send-as-identity', dest='sendidentity', default=None, + help=('Use git-send-email to send exploded series (use with -e);' + 'the identity must match a [sendemail "identity"] config section')) + sp_pr.add_argument('--dry-run', dest='dryrun', action='store_true', default=False, + help='Force a --dry-run on git-send-email invocation (use with -s)') sp_pr.add_argument('msgid', nargs='?', help='Message ID to process, or pipe a raw message') sp_pr.set_defaults(func=cmd_pr) |