From 1ac98d05d1a665f4376e3652163b9f3c17b6f808 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Tue, 8 Jun 2021 10:57:05 -0400 Subject: 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 " -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 --- b4/command.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'b4/command.py') 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) -- cgit v1.2.3