From patchwork Wed Feb 22 01:29:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13148581 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9C631363 for ; Wed, 22 Feb 2023 01:29:46 +0000 (UTC) Received: by mail-qv1-f46.google.com with SMTP id f1so7735426qvx.13 for ; Tue, 21 Feb 2023 17:29:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yWaxWAlMcLUKLLQLKu+zg3Fg4k8x853cqwk1ZQF/8JI=; b=Zm20qWXP6QHQyTVqL0o7J4nykdr6c1hihOElcBrQdPkaViopzHCR/fpDBhnVUQ+DoX qxgDk7al+/2nSOPRzgAtBbLp2IdEbjMc2EQIon0TVkQPMA2yXBEySQRZ5ukWNQoHqPcz cmGQvt4A6Nj9qVTYIhBdi+tGzrDpLoK3Psoe6VQjPNAQAE9FpeS/gKPT052jsKD/hhHc Ngyl6gbzh6fVsQhZhrKdjAR9ASgVbzm4NQbY9NQw6YP0Jiy/zaAWzJrTNVvKA8LioF01 SXThmBcchZKgH5uvj7HdGnCjKBCJ/4PqhnnWgGLubnSD/lNK3kx+mv5CzE8UAKjvzH0w XVcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yWaxWAlMcLUKLLQLKu+zg3Fg4k8x853cqwk1ZQF/8JI=; b=lXI38pNrBP/BYfjpVKGK3iyU/4hx2hesvMjThzzy3QoxHJlkPmdfXaVkroxp2wnqD3 9ffNzk7NHEBkRhamMw/kH9CgNPA61Zzq4W3Lzti/WnZwf3L22Zu53yUuSy59liAvSDFi 9ey+TP9fU2Hs9UWR3m+kgzf1vnoqg7N6/fsBMLK6d1cdYz0wKkZCZu14iWlcSB/W23iA eYTb/11bw4l9fjcHBbeF9joz01SdgzF0/lRR62pSNSBmc8ZezQntonjMat6DYpu0s5PZ fvW8Fm1iEPT34szJzriKAwH1v0pzWAW4YlMYzXpmeQnQqK3DGKYysl0VIq8kIEXmbsGW UIaQ== X-Gm-Message-State: AO0yUKWQDeKoZ0AN66h0e1wDd4o6qqJXs/d98w6NqpM32kV3qtVKLsyr vjkmgAvsfVMHF6ZyCukuXgxKm/v1bgk= X-Google-Smtp-Source: AK7set8Vj+tS4ZZluRc2w0Aa/BI0kDxcLV+H+/9Lz3cLhnDn6dOrIGQcIDsK3JFcmiAC8kMeQ1LBhA== X-Received: by 2002:ad4:5c6c:0:b0:56e:93b6:27fc with SMTP id i12-20020ad45c6c000000b0056e93b627fcmr11507038qvh.17.1677029385693; Tue, 21 Feb 2023 17:29:45 -0800 (PST) Received: from WQUEN758573.ncr.int.ec.gc.ca (ecodor135.cmc.ec.gc.ca. [205.211.133.135]) by smtp.gmail.com with ESMTPSA id o190-20020a375ac7000000b0073b45004754sm11872357qkb.34.2023.02.21.17.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 17:29:45 -0800 (PST) From: Philippe Blain Date: Tue, 21 Feb 2023 20:29:17 -0500 Subject: [PATCH b4 1/3] ez: allow iterations to be sent in a single thread Precedence: bulk X-Mailing-List: tools@linux.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230219-send-iterations-in-same-thread-v1-1-59b802382eb5@gmail.com> References: <20230219-send-iterations-in-same-thread-v1-0-59b802382eb5@gmail.com> In-Reply-To: <20230219-send-iterations-in-same-thread-v1-0-59b802382eb5@gmail.com> To: "Kernel.org Tools" Cc: Konstantin Ryabitsev X-Mailer: b4 0.13-dev-696ff Some projects prefer further iterations of a patch series to be sent in the same thread as previous ones. Usually this means that the cover letter of v2 is sent as a reply to the cover letter of v1, etc. Add a new optional argument to get_prep_branch_as_patches, 'samethread', defaulting to False. When True, add an 'In-Reply-To' header to the first mail in the series, referencing the Message-ID of the previous iterations's cover letter. This functionality will be exposed to users in a following commit. Signed-off-by: Philippe Blain --- b4/ez.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/b4/ez.py b/b4/ez.py index 74afddc..dac5e2a 100644 --- a/b4/ez.py +++ b/b4/ez.py @@ -1117,7 +1117,8 @@ def get_mailfrom() -> Tuple[str, str]: return usercfg.get('name'), usercfg.get('email') -def get_prep_branch_as_patches(movefrom: bool = True, thread: bool = True, addtracking: bool = True +def get_prep_branch_as_patches(movefrom: bool = True, thread: bool = True, addtracking: bool = True, + samethread: bool = False ) -> Tuple[List, List, str, List[Tuple[str, email.message.Message]]]: cover, tracking = load_cover(strip_comments=True) @@ -1191,6 +1192,12 @@ def get_prep_branch_as_patches(movefrom: bool = True, thread: bool = True, addtr if addtracking: patches[0][1].add_header('X-B4-Tracking', thdata) + if samethread and revision > 1: + oldrev = revision - 1 + voldrev = f'v{oldrev}' + oldmsgid = tracking['series']['history'][voldrev][-1] + patches[0][1].add_header('In-Reply-To', f'<{oldmsgid}>') + tag_msg = f'{csubject.full_subject}\n\n{cover_letter}' return alltos, allccs, tag_msg, patches From patchwork Wed Feb 22 01:29:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13148582 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B28A51360 for ; Wed, 22 Feb 2023 01:29:48 +0000 (UTC) Received: by mail-qv1-f49.google.com with SMTP id y12so6888995qvt.8 for ; Tue, 21 Feb 2023 17:29:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=CvX7GFBdbdRJOtfMx0uMRzsL8l0PiLl4BsNZU/l8fI0=; b=YKXolNeoWFZJGEkVpRHfCYA6KER4IjOCRyNKJDAIGRxa36jErDPLV6M/O6ENrE0dsl BnNQ9q2ZRf3vzO+7nYxmtiWXkzdOJVOq0CbkjcA/c3Xls0r4y6CyZNXKzwx9/nPSlp56 Kt81t+o1W1XjzYLm6ftAoxFjjuLT3wEu1k80eNw06n7SH6NZjadp0BJ3/Qg5Tv29UCxB lldXUDwQrV2TS39T4hj8ndQ7CDJ1rttHxN9Rv8IGwdhBKBxv2UCRMejI/XrX3cxBzfxj CS9BtGh39WN01TTh0xhllH71Vz9SiPm27C+gjFzA2XEAhWNidakVVXdd7nrON8qqG55m 4gQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CvX7GFBdbdRJOtfMx0uMRzsL8l0PiLl4BsNZU/l8fI0=; b=dsLcNY0VRuPJc37+PAzZCw7120a/jRm2kJV+AUdPqoXRjdyUBJ25rei85ebwTtC81w kXgf4y9mfOOxsG2kd0IeZon+c7c63f3ThmR7Zvi17cJLEAiy+b5MpqwXwFcHFpZzRDWg bxq1oKZnHP30HfZN/nahkRO4DoJGGSkBO7bbIAkuBNelPuIcSokSpDWdufoQp2lazM2x BRgn/BtX6CFKO6tNEXwCSElwo1+EA0jtH/vGK5JVnb3rQOKjDQRVORY/EV4WS0fb4Avt pSDm3btYA0fF9kS+ky5pe/LILnJK73UsNLYZT6AJ8w31lDkJLKLNgpAwbyVF0UnXfDSf JkMA== X-Gm-Message-State: AO0yUKW1x3X8wwQQrIxCrYx+mlSGXsxcRboFEJY8wvFxxKAeXWeyzhEo nf7/xMvU1U9O9IPvr/NBU/GfkxVroyY= X-Google-Smtp-Source: AK7set+i4kJ3EVgw8hVpSFA7npX8di5SiYj2iSJfNCWRWBCq6V90sdYk5fjnx4UK3G2c5mY0+9T74w== X-Received: by 2002:a05:6214:d49:b0:56e:f417:2ad7 with SMTP id 9-20020a0562140d4900b0056ef4172ad7mr13502018qvr.14.1677029387584; Tue, 21 Feb 2023 17:29:47 -0800 (PST) Received: from WQUEN758573.ncr.int.ec.gc.ca (ecodor135.cmc.ec.gc.ca. [205.211.133.135]) by smtp.gmail.com with ESMTPSA id o190-20020a375ac7000000b0073b45004754sm11872357qkb.34.2023.02.21.17.29.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 17:29:46 -0800 (PST) From: Philippe Blain Date: Tue, 21 Feb 2023 20:29:18 -0500 Subject: [PATCH b4 2/3] ez: add '--same-thread' option to 'b4 send' Precedence: bulk X-Mailing-List: tools@linux.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230219-send-iterations-in-same-thread-v1-2-59b802382eb5@gmail.com> References: <20230219-send-iterations-in-same-thread-v1-0-59b802382eb5@gmail.com> In-Reply-To: <20230219-send-iterations-in-same-thread-v1-0-59b802382eb5@gmail.com> To: "Kernel.org Tools" Cc: Konstantin Ryabitsev X-Mailer: b4 0.13-dev-696ff The previous commit tweaked get_prep_branch_as_patches to optionnally send further iterations of a patch series in the same thread as previous ones. Expose that functionality to the command line by adding a '--same-thread' option (defaulting to False) to 'b4 send', and pass it down to get_prep_branch_as_patches. Document the new feature. Signed-off-by: Philippe Blain --- b4/command.py | 2 ++ b4/ez.py | 2 +- docs/contributor/send.rst | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/b4/command.py b/b4/command.py index a7a5aa9..21f0d0d 100644 --- a/b4/command.py +++ b/b4/command.py @@ -323,6 +323,8 @@ def setup_parser() -> argparse.ArgumentParser: help='Resend a previously sent version of the series') sp_send.add_argument('--no-sign', action='store_true', default=False, help='Do not add the cryptographic attestation signature header') + sp_send.add_argument('--same-thread', action='store_true', default=False, + help='Keep all versions in the same thread') ag_sendh = sp_send.add_argument_group('Web submission', 'Authenticate with the web submission endpoint') ag_sendh.add_argument('--web-auth-new', dest='auth_new', action='store_true', default=False, help='Initiate a new web authentication request') diff --git a/b4/ez.py b/b4/ez.py index dac5e2a..4013f29 100644 --- a/b4/ez.py +++ b/b4/ez.py @@ -1295,7 +1295,7 @@ def cmd_send(cmdargs: argparse.Namespace) -> None: sys.exit(1) try: - todests, ccdests, tag_msg, patches = get_prep_branch_as_patches() + todests, ccdests, tag_msg, patches = get_prep_branch_as_patches(samethread=cmdargs.same_thread) except RuntimeError as ex: logger.critical('CRITICAL: Failed to convert range to patches: %s', ex) sys.exit(1) diff --git a/docs/contributor/send.rst b/docs/contributor/send.rst index bff67aa..6abceac 100644 --- a/docs/contributor/send.rst +++ b/docs/contributor/send.rst @@ -233,6 +233,11 @@ Command line flags ``--not-me-too`` Removes your own email address from the recipients. +``--same-thread`` + When sending a new version of a series, make it part of the same + thread as the previous one. The first mail will be sent as a reply + to the previous version's cover letter. + ``--no-sign`` Don't sign your patches with your configured attestation mechanism. Note, that patch signing is required for the web submission endpoint, From patchwork Wed Feb 22 01:29:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain X-Patchwork-Id: 13148583 Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D52D01360 for ; Wed, 22 Feb 2023 01:29:50 +0000 (UTC) Received: by mail-qt1-f169.google.com with SMTP id ay9so6359562qtb.9 for ; Tue, 21 Feb 2023 17:29:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ME8B5jJjjihoht2MiOzPx2MGyBQSZZlq0ec3/VJlphk=; b=QTuBOgSgDSIWyhMu9NO2XatefONxZxcPORdWZvgv1az1xdXwIBbhlPokPlZdnJzFVg FVXzyLPkgyTbNb6vBiMTNCFRtqIPBGpr9z3fXAw3wRTckHac3IS/mb5A37VUq1Un4jtb cJ48pqeIf/s9KuEXVqS9FB+SiGz3tcoMJInoqqC2/mm0oJaQVHl7TmklUbrLbHKL/w3O gtvBxeo7Rf+y/fltlpvb0h2lcX6ajnagDY1/+zViz4amXqzlwe7Zm0qhWi7Qce19bnPa hGfQ5/o90CthGvO/XBVaTKN4luccLiOQjv4S9sPljzKCTUPSnb7WZhNYVJrHWDCOzYIY 27Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ME8B5jJjjihoht2MiOzPx2MGyBQSZZlq0ec3/VJlphk=; b=Lrg1eiFWxrWn0At0ljoGmFHV9/5CT3s6d2Fxr9Alu1FpRzPUoVzE59tTsxv1WOwFk9 c6j7/sXTrc8Lmd+lxc4tO+Lk4TsdeZdfpflAU5+4tlz/tp6Q5IZUyytXyuiYeYVzyMiU fton9qRKpOMEHvzEHPmsEx8kL7blPMAr0+eIKB2mAxWZ/RUvefsRrYGbGoXg+QvpP1MA QZuW9SW19H33fiUsYxdwczeSbp8KPdg53NsuxBp6dz7rJM/NEjuAMlPPwxs6QxTtevrj 35g5lA4j9gkNc2DxU9V9VDb/QOevcLYPXJqHYM18fPPGs+161xL5WVUruWFeV+GDbjDK f10g== X-Gm-Message-State: AO0yUKWZdm0pclO3vqKMOojDrHHbaioerkpRN82rlkXQgHFgM6YIxPJK 7RQQmamLEaqpNULrggFz5faV2FeYKww= X-Google-Smtp-Source: AK7set+IdnPmtV2RjgG5tbVVSnF4OBx1pw1PJ4jkVJqLO8HRyFN6EGI00zkmf+k8OgzR5OKMSNuBFQ== X-Received: by 2002:ac8:57d2:0:b0:3b6:93fe:443c with SMTP id w18-20020ac857d2000000b003b693fe443cmr28087890qta.32.1677029389818; Tue, 21 Feb 2023 17:29:49 -0800 (PST) Received: from WQUEN758573.ncr.int.ec.gc.ca (ecodor135.cmc.ec.gc.ca. [205.211.133.135]) by smtp.gmail.com with ESMTPSA id o190-20020a375ac7000000b0073b45004754sm11872357qkb.34.2023.02.21.17.29.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 17:29:48 -0800 (PST) From: Philippe Blain Date: Tue, 21 Feb 2023 20:29:19 -0500 Subject: [PATCH b4 3/3] ez: add 'b4.send-same-thread' config for 'b4 send --same-thread' Precedence: bulk X-Mailing-List: tools@linux.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230219-send-iterations-in-same-thread-v1-3-59b802382eb5@gmail.com> References: <20230219-send-iterations-in-same-thread-v1-0-59b802382eb5@gmail.com> In-Reply-To: <20230219-send-iterations-in-same-thread-v1-0-59b802382eb5@gmail.com> To: "Kernel.org Tools" Cc: Konstantin Ryabitsev X-Mailer: b4 0.13-dev-696ff Allow the default for the '--same-thread' option of 'b4 send' to be set in b4's config by adding a 'b4.send-same-thread' configuration option. Signed-off-by: Philippe Blain --- b4/ez.py | 5 ++++- docs/config.rst | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/b4/ez.py b/b4/ez.py index 4013f29..f0861ed 100644 --- a/b4/ez.py +++ b/b4/ez.py @@ -1295,7 +1295,10 @@ def cmd_send(cmdargs: argparse.Namespace) -> None: sys.exit(1) try: - todests, ccdests, tag_msg, patches = get_prep_branch_as_patches(samethread=cmdargs.same_thread) + samethread = config.get('send-same-thread', '').lower() in {'yes', 'true', 'y'} + if cmdargs.same_thread or samethread: + samethread = True + todests, ccdests, tag_msg, patches = get_prep_branch_as_patches(samethread=samethread) except RuntimeError as ex: logger.critical('CRITICAL: Failed to convert range to patches: %s', ex) sys.exit(1) diff --git a/docs/config.rst b/docs/config.rst index b3ab5ca..0fd68c5 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -351,6 +351,10 @@ Contributor-oriented settings Default:: ``scripts/get_maintainer.pl --nogit --nogit-fallback --nogit-chief-penguins --norolestats --nom`` +``b4.send-same-thread`` (v0.13+) + Send all versions of a patch series as part of the same thread. + + Default: ``no`` ``b4.prep-cover-strategy`` (v0.10+) Alternative cover letter storage strategy to use (see :ref:`prep_cover_strategies`).