From patchwork Tue Mar 19 18:35:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kristoffer Haugsbakk X-Patchwork-Id: 13597019 Received: from wfout5-smtp.messagingengine.com (wfout5-smtp.messagingengine.com [64.147.123.148]) (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 5BF2639847 for ; Tue, 19 Mar 2024 18:37:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.148 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710873424; cv=none; b=Bur/6MLqOXOtbvJhJZrasiK8DBsB65l6UTbcPY4lmNHoMRPVEyNSBC/ErKBYzP0Uxy4ZHMc+LclKSo5OvT/JsNxsONAUUrzmtiLgpCHkX8mDajA9e8FHwEtp84bYQ1m7inhdAK5yrVIJj2JkN0FTOfF54Ompw3PsWKS+do4IdKk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710873424; c=relaxed/simple; bh=G6b3RnUAXvy9UiHCTgEZa0UbeRWPPPuduFNuEE/2MzI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MNZKEjePHcmQnX+EG4oxHeg5xYiFV+P58Me9CA18duTP0EyxFUx4YictZ6AuY8TTCORT1ZeR+JgMiRSVCLfW0iJ4OZfg7M4V30ATzL8p0ot0EcqkBszdGmpajub2yJxEqJTS+QMhwDIz6IqOhiQs7Sup+gn9f8noLVQvz3ulOZ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=khaugsbakk.name; spf=pass smtp.mailfrom=khaugsbakk.name; dkim=pass (2048-bit key) header.d=khaugsbakk.name header.i=@khaugsbakk.name header.b=H/eAulIb; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=YugZ9uI6; arc=none smtp.client-ip=64.147.123.148 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=khaugsbakk.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=khaugsbakk.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=khaugsbakk.name header.i=@khaugsbakk.name header.b="H/eAulIb"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="YugZ9uI6" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.west.internal (Postfix) with ESMTP id 135E71C0009F; Tue, 19 Mar 2024 14:36:59 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 19 Mar 2024 14:37:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=khaugsbakk.name; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1710873419; x=1710959819; bh=uWJ3ATpIG2UOA93nhNPVvFKuOx5aKnKz rnvAKCw6QAk=; b=H/eAulIbgH6WcW5S0GJjHANvUrBuh+k+MOZ9adW5rJ+xghEl tkvjmSp66FAg1jaAgptUd+g2oNkQ4FC7D6AmTmwG9dM8eWsI4Qv/9WCDGqwhPwnj vQ0xDHluLGHzJtbOB1bKCar1zlFuX+tV9ydCVF0g6bQHgFnF3YcsdzK8gjL0oCts j7STGh/uiFnz65E1/JedegIaD4YUXsRfh51Vm3CVYtEULIQt25SOlAwsUv1313ot rMw8U5KvfA3y8G9G5mbQDdDDJdvJpliYrIwrvYYu22GaHDooCuhYEnY/zH5M8Bq9 URNEHVSDj7enp6aeGNphhlkfDH1GnnA1qKeWTg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1710873419; x= 1710959819; bh=uWJ3ATpIG2UOA93nhNPVvFKuOx5aKnKzrnvAKCw6QAk=; b=Y ugZ9uI6uWmMOSJXEdN76tS5YEr8iurQj/JauZQ7u3dsKgFuIZI7K4JndsL1swrNX DYdh7A8b8XknI/S49iERcElf33UlV+DIjwvrZNp4ktM9KzVMY+DdTz7CcenOQ1Ww IuWKPDU/rzk8phdvbZczeLoxG9PlOKiBxflXQ/kbXPoaZwj6rBdHmY1FQD2gHdFL Q6zXYtPrjvaziOBYLUvUElGzgTUOWkA43mcMvIk9MvH0vI0fGjxfnSWo5xLE6bMS lL/tVUHi5GrHugOPwCOzxoGb8z5OccyBQGCKcgV/CnHcTuwIk7cz6xTS508HUEeB dFR7dmFAz9wQWy49DoIgQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrledtgdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepmfhrihhs thhofhhfvghrucfjrghughhssggrkhhkuceotghouggvsehkhhgruhhgshgsrghkkhdrnh grmhgvqeenucggtffrrghtthgvrhhnpeffhffguddttddthfeiledvtedufefgjeelfeeu ieekuefgfedtudeivdfhvefgteenucffohhmrghinhepkhgvrhhnvghlrdhorhhgpdhgih hthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpegtohguvgeskhhhrghughhssggrkhhkrdhnrghmvg X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Mar 2024 14:36:57 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , Jeff King , Maxim Cournoyer , =?utf-8?q?Jean-No=C3=ABl_Avila?= Subject: [PATCH v2 0/3] format-patch: teach `--header-cmd` Date: Tue, 19 Mar 2024 19:35:35 +0100 Message-ID: X-Mailer: git-send-email 2.44.0.144.g29ae9861142 In-Reply-To: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (most of this is from the main commit/patch with some elaboration in parts) Teach git-format-patch(1) `--header-cmd` (with negation) and the accompanying config variable `format.headerCmd` which allows the user to add extra headers per-patch. ยง Motivation format-patch knows `--add-header`. However, that seems most useful for series-wide headers; you cannot really control what the header is like per patch or specifically for the cover letter. To that end, teach format-patch a new option which runs a command that has access to the hash of the current commit (if it is a code patch) and the patch count which is used for the patch files that this command outputs. Also include an environment variable which tells the version of this API so that the command can detect and error out in case the API changes. This is inspired by `--header-cmd` of git-send-email(1).[1]