From patchwork Mon Sep 2 16:51:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 13787523 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FCC413D50A for ; Mon, 2 Sep 2024 16:51:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=10.30.226.201 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725295889; cv=fail; b=czNUi0yPdRYiq57Rb4BBnIvOpmyjWJTWyetzw6TVqsICpl2jKm3pDhKJpXeLqgvGccZlBIZOz4ymAxMggYOmIqp+EcAkHyGFiA1Ks2LNM/Q70FW9Tl9rngd8BJNSqfIO3yNMfZijsic/3aMExutWGThoIkYtUI61FB5+q/4ZoBU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725295889; c=relaxed/simple; bh=q5UdcKAJuG7D9P++vvqqDkJHFtS6dpENh5ZdfsSNSvg=; h=Message-ID:Date:To:From:Subject:Cc:Content-Type:MIME-Version; b=KWc3YwWdyt6unjECj4AgRXcFhHN7M0MfOeRNiW67mIP72ZvOISn6ZDWirQSIHPntVbhOgZNhpRsyqiDCfnuKAKvDV2Atj0f1jk51Dsy6Q4nZ+RtpAqeTG8KXDh3w+jlBgq/uX+RvCGyKjBR83Xvr9LcfhqqRfuZdfCVIL0OnHAY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b=TmVJs703; arc=fail smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b="TmVJs703" Received: by smtp.kernel.org (Postfix) id 00716C4CEC4; Mon, 2 Sep 2024 16:51:29 +0000 (UTC) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013035.outbound.protection.outlook.com [52.101.67.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 8185EC4CEC2 for ; Mon, 2 Sep 2024 16:51:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.kernel.org 8185EC4CEC2 Authentication-Results: smtp.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de Authentication-Results: smtp.kernel.org; spf=pass smtp.mailfrom=cherry.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d0m1umMpNhXHiDYAvQ1scecnaydpJjs+meE5lWJyIoV06I2QUMYE7NbxdhiOiRhCNgS3+NVSDC01JBP4XY3xLZATn8ybxYR4OdYaZFfbqs0n5cR+MFM9BHjgukELxXchpGvgT3nXhT9LQYGr5zQeOmanv8ib5oRViz6rKnSnTmH4yW2cPuo5TJar/LXx2HRf22RfHNl0Qg+VHGKK7JauaiGjHG2oevNTXDkGQ2zSt04nYWHvkBNCX18gHCB+UQmLfzDbE/TXxVst0qPTIAoqjvOAf3GGEunjcbBMktOjVtWbCViE+1fnweE6kKa1dp4Y5v5q3gkOiiSG4TZk8b3ZsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5iU66szw2Ui75G0O4htvum3mTtgWZg+SFX1bWBR31Cw=; b=uGtbaG1dgB4+38G8bq0Ems4Vw1Emn/poqE2gbQ5scEzZCnTLJejVaXIUC6GVrKmKpnQmokTWQbuDNOr7geBG2Bd2XrJoDM6VkmHV6rg+OMFgkiNyVhBxbseG26MH4dFsS2CSv8t+SdyaFD4ZYfp3lwzguip2xXl4o5UBrd0bF2q/z2XLte9gQlQraYC9oi/ctTopvTZDEqYnrkAuKtfJ+Jyp5I753M7BT8S8IZU4tWQBZGx73SqlmZzr6s6tb+VfsOCXNzncRJ9dQpdzetxSDsOxg5838C5U+qj4X7RNsof3wuF0B2WySQs7R7CmtBAPlfpOTj3bRE6NomD9HiNYGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cherry.de; dmarc=pass action=none header.from=cherry.de; dkim=pass header.d=cherry.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cherry.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5iU66szw2Ui75G0O4htvum3mTtgWZg+SFX1bWBR31Cw=; b=TmVJs703C+jIDw+VjwFZG9EU3wHrTvY78b1m6+RsyUWpgG2cl+TBT6CNtyzh+bIZhvK/ZRTuhHODJvc+bMaBtvGsQ/OedCKYkqhvuODRquJ67SHPtO8mFg87M1DCg1jIE98uY+667X3eK687Y1wKyp+gphwEblhIFgcXkDSGkng= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cherry.de; Received: from AS8PR04MB8897.eurprd04.prod.outlook.com (2603:10a6:20b:42c::20) by AM8PR04MB7985.eurprd04.prod.outlook.com (2603:10a6:20b:234::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.24; Mon, 2 Sep 2024 16:51:24 +0000 Received: from AS8PR04MB8897.eurprd04.prod.outlook.com ([fe80::35f6:bc7d:633:369a]) by AS8PR04MB8897.eurprd04.prod.outlook.com ([fe80::35f6:bc7d:633:369a%5]) with mapi id 15.20.7918.024; Mon, 2 Sep 2024 16:51:24 +0000 Message-ID: <4bc5dee0-ed3a-442c-a9ee-d48050627576@cherry.de> Date: Mon, 2 Sep 2024 18:51:22 +0200 User-Agent: Mozilla Thunderbird Content-Language: en-US To: "Kernel.org Tools" From: Quentin Schulz Subject: [b4] add notes to patch for commit with git-notes? Cc: Farouk Bouabid X-ClientProxiedBy: BE1P281CA0314.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:85::15) To AS8PR04MB8897.eurprd04.prod.outlook.com (2603:10a6:20b:42c::20) Precedence: bulk X-Mailing-List: tools@linux.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8897:EE_|AM8PR04MB7985:EE_ X-MS-Office365-Filtering-Correlation-Id: d8b57ee4-c345-4bde-f5f7-08dccb6f7acf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Qw1UxKP1ahdsJhCIwaOwi0XOCB2rLWd?= =?utf-8?q?O9LosXSLnXgc+hZvrk7KJSrcaZEIgeGWBaZoLBZRoKcig0YcGuMYGLcWGfT1vI698?= =?utf-8?q?JljihicZ2iWc59xMYQs89/WD2r/QJQrS5ySTz/4w75s7P3r0wZC82pbgF1LTp/oTf?= =?utf-8?q?2hI8RpKj74PrSW4YBa4QIRFDNThs2iinBQm/ShXElwGywU+ZPIuHFLnchCOBdVHlq?= =?utf-8?q?swWcatlEn1zQ8T75zlDIELVN49shHmdRqFpNgRzj/0GP7zOgFEXCfnc1q+bnMgUbq?= =?utf-8?q?MM/9V1+B6m/mkAolkzfGG+1/TAOCG/zpCoDPKK6z/YcvNBOLzsLtvi4lpOUyMf01h?= =?utf-8?q?u7NpIqrBcIG8u9jJ595pjFKIjgny84WYtXDPFeT9fioOUsQ0VZJMf9ZJQTjAo2+cr?= =?utf-8?q?9zwYMaObjOmgR1CMt7iJvEc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CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8897.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?RoFyAMKAkt+VDJ425pV/2tglij6F?= =?utf-8?q?l1IYrMYp7EjJ2tT2GWLilV2919DqyIjLFI8Ji/cOvtQRkcsIhNgQePgWk+CEK1RG3?= =?utf-8?q?/vXeImj9dozBoazR25xY+FCkaqu6JwFYfRhncpbMtBl0cA7PrG70PDqyhhFUg/6Nm?= =?utf-8?q?sr+q7DcKEYzKJ166u9lbaZ9Sd5qQiOQbYJiNRcuOTENLkjJm4BU/ecqf15LHwjJiA?= =?utf-8?q?Se6pXYqdTsn3BQfp6S60m0I9WxjKe90hgf8pJ669YvB6g0MZ4SECSXgfmNK55RmkS?= =?utf-8?q?9iG7xKekJZeSwC+byugXdrhhHz3Ydj1B+2Fk4frlFYsmD+15IIFs2E/3cMf5Gm3y5?= =?utf-8?q?ms6vmHeVsj18hgAEZcuVRuv6h2dPX0eDY2AeSO0e/ehu6Xj5swLWkdN+QjRUmTvg7?= =?utf-8?q?IVufrrEfPmINMsFZG4U/1CQpg5XJhb6OOsFQbJXjbFEjFbxL81EcX30lz//NCaumR?= =?utf-8?q?iSm3jnRCwgOJjA8Fl95od46E+HvUmWysKqSwuXXPEXyhzWPWo4SY7F7YT/zBeCTaS?= =?utf-8?q?EYYiePieB4Y59PSaWZclCQW/4t2yhZvWtNYAPwFllnqtt/2Pq7CLbEMndPvTpG4Ly?= =?utf-8?q?L1qdHUgkjalmf5AMP3NLTxHUhSv8mr23fD2zTYegNwdwkuUQohjylm/GlKSfWKw+5?= =?utf-8?q?VhMoSLnjC5PnKWislCMo6ocfnbKrfKcGBs/xRRWysLXYF5X1VQu5G/BHAA6ORgqr8?= =?utf-8?q?qqBZ+qXc39EanXWY4O65E3lFesgls3KDoPRTgQxk10tAgcShDXE9wWARYXS+tMu0C?= =?utf-8?q?u3sbZGFiDQJ+PcRps161F4HIdeyk5ag/tFUsUnQu724IV/INjFYBQPBFVcwkbwUxi?= =?utf-8?q?7bp2NpyEAvDN6MQ5ptDdw5raJUb6g4AGar3lirKp7c23ZLL1bCP7Su9C1TjVNKUWr?= =?utf-8?q?F9RpDIxq+/ERyZGw6P3ybL9AII6uGIzn58ERiGb7RtnQCoXOJg6l8UkCLW3uAnjSe?= =?utf-8?q?u8W4qI0NRJZV890hRFfJhYx+FekueUcG4YjzH87vSO3iCjutBqt2GMIzITQ4rcxR9?= =?utf-8?q?YoBrRv5/NxMBtGan2+497/N5l8rrUeTxeLEtfPl01ep19vuFdN5QTHZAopctf8rRM?= =?utf-8?q?EAZAP8QQrjKOhryhtuRLWfUMYPos6j1WoKM85Y4MXb75JHHjM6rStSZpce2FAkvk5?= =?utf-8?q?NhywI9YrEWguQAxukz2HQne0iRlcMrMZrGn47Bilq+QmMSoe6x3+fc6XULIMCsLij?= =?utf-8?q?73FsRECUzmgzUwLK+HKHfJJTiCdw6j2RsVsZVqyJfj2DsJxoUYN+l8BnSoVQx9PmH?= =?utf-8?q?TDFxu0ylvyeN0LJC9o87Sxyr4ag9a7Poll81XZ95/PQGTZiOBazeoA6g9+Rt8Dw8k?= =?utf-8?q?whXhDfKVvhdMUQYgR8Zw1K77sKT6/Ey8JDHM9PdqTwRZrLwYJ/dtZ5d8K8ev1bj2m?= =?utf-8?q?gbaI4+ZBGZp6Bu+xV30BDe5usCV8mdAtyLY51+iRGBh936l3UiPH6yTNFhPZXDDvB?= =?utf-8?q?Wv7FF6wVfmyI4rvqF0HfwFOv6Mu73Bsi3CNnhA0L/LnBYurcSwnQ4SPwv311okr4b?= =?utf-8?q?i9WqRvzAmIMIeK9VMm2SeH6OBmx/rMU+lg=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: d8b57ee4-c345-4bde-f5f7-08dccb6f7acf X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8897.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2024 16:51:24.3023 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5e0e1b52-21b5-4e7b-83bb-514ec460677e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lgUrcue6TtH14qg1mcJDPR+dYytO+46lcgsccWfw6cm6kR3ya1/xP7cbQhIsL1R7tnQBm/Rly11OvOXCgjYhj+3rJKgBovrZ5oXxfQdj8oo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7985 Hi all, https://www.kernel.org/doc/html/latest/process/submitting-patches.html#separate-your-changes says that > If one patch depends on another patch in order for a change to be complete, that is OK. Simply note “this patch depends on patch X” in your patch description. We forgot to add this note (we weren't aware of the rule at the time) and made some people unhappy due to some partial merges (one part going through one tree, its dependency in the same patch series still in review). I asked some maintainer whether we should have this note in the cover letter or in the patch and the answer was "ideally both". I know how to do the former with b4, but not the latter. I would like to avoid having to use multiple tools to do the same job. I think it should be possible to use git-notes for the latter? We did a quick test and it seems it works (with a diff I'm pasting later in this mail), c.f. https://lore.kernel.org/linux-rockchip/20240902-dev-mule-i2c-mux-v7-3-bf7b8f5385ed@cherry.de/ For that we had to set notes.rewrite.rebase config to true so that b4 prep --edit-cover wouldn't "erase" the notes (and same with notes.rewrite.amend just in case one does git commit --amend or reword with git rebase). The diff we had for b4 to make this work is the following: """ commit], decode=False) if ecode > 0: raise RuntimeError(f'Could not get a patch out of {commit}') """ Now I'm wondering if we should have this always on or not, also if/how we should document that one needs to have notes.rewrite.rebase/amend set for this to work. Should we also add a knob to NOT add the notes (e.g. someone wants to keep notes for their use but only locally and not send those). Let me know if git-notes would be fine and the direction to go for patches. Thanks! Cheers, Quentin diff --git a/src/b4/__init__.py b/src/b4/__init__.py index ec230e7..72621b8 100644 --- a/src/b4/__init__.py +++ b/src/b4/__init__.py @@ -3424,7 +3424,7 @@ def git_range_to_patches(gitdir: Optional[str], start: str, end: str, if commit in ignore_commits: logger.debug('Ignoring commit %s', commit) continue - ecode, out = git_run_command(gitdir, ['show', '--format=email', '--patch-with-stat', '--encoding=utf-8', + ecode, out = git_run_command(gitdir, ['show', '--format=email', '--patch-with-stat', '--encoding=utf-8', '--notes',