From patchwork Wed Apr 12 19:52:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kristoffer Haugsbakk X-Patchwork-Id: 13209483 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E12ABC77B73 for ; Wed, 12 Apr 2023 19:57:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229517AbjDLT5j (ORCPT ); Wed, 12 Apr 2023 15:57:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbjDLT5i (ORCPT ); Wed, 12 Apr 2023 15:57:38 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC9111FFC for ; Wed, 12 Apr 2023 12:57:36 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 444265C00D6; Wed, 12 Apr 2023 15:57:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 12 Apr 2023 15:57:36 -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:sender:subject:subject:to:to; s=fm2; t=1681329456; x=1681415856; bh=pztcFc9X2ktTHsUCMLfQM4LuJ evaMQWgCH0tivhknt8=; b=nBgE/tcwrNQ9GEGIUDidXsbkvc9tfxvZh3/iZFu5g ylAu5xvJMg3m4FMLctI68n7BzldVbm/S2MDjWVYnnNzMc8pcnYGeFXaXiLOht935 JB0BlAmLweVaGj7tGIu//L7iacJaez0QHIg43+w3sHAVmFHuMdN+OVwk78w4gXnR 6o95f03XA2W6YbLjhEeFK5bH9dV4fNhTtRgsxZuI4/xq8kwxoygOjtpPylMO7Reb /KTZbF4HmCBw+3Sai5xYyehZeRoQmt+gfoQNO061PL4HQwtimYsxxQQbhsyFL1BP AUYELlm9DPR/x2eD4aI9/X+ZgX2HbmrCs744CGj4zzpxw== 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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1681329456; x=1681415856; bh=pztcFc9X2ktTHsUCMLfQM4LuJevaMQWgCH0 tivhknt8=; b=YmUF0fWxhrFJB4AWOoApTySQKo6CN4Xg7pafdHYVodXDyU2b82l DQnDydLxdDpa5qNfFpFGHutoaRO91shZrLVniIBOeDRRweiiNW1nw42573EC8wjX LQoNKnSmc20FsUSxvxIxRAfu70B7HyJbIsg108bnnxM8PTaxtqCPJNXtLTfX/BNa 4tidTBRZoQGjgHeKsdG6w+2FlHROEMi42JxGFo8mOWQArLnXicfSwM95YsrIkZoA Bi/p146iLJgFGZyajQdP21KPuXwJltVLZffOG+cAVTANoJ8m+7aws3Y/8i3+ZQZ9 f7ndbJ0wxorIAfOvpmrUAMU+hEy0j9bNtJg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdekiedgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhggtgfgse htkeertdertdejnecuhfhrohhmpefmrhhishhtohhffhgvrhcujfgruhhgshgsrghkkhcu oegtohguvgeskhhhrghughhssggrkhhkrdhnrghmvgeqnecuggftrfgrthhtvghrnhepve fgleevieekgeejieekueevhfelieduvdelgeefkeejtdekvedttefgffevtedtnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheptghouggvsehkhh gruhhgshgsrghkkhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Apr 2023 15:57:34 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , adlternative@gmail.com, christian.couder@gmail.com, Junio C Hamano Subject: [PATCH v3 1/4] =?utf-8?q?doc=3A_interpret-trailers=3A_don=E2=80=99t?= =?utf-8?q?_use_heredoc_in_examples?= Date: Wed, 12 Apr 2023 21:52:12 +0200 Message-Id: X-Mailer: git-send-email 2.40.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This file contains four instances of trailing spaces from its inception in commit [1]. These spaces might be intentional, since a user would be prompted with `> ` in an interactive session. On the one hand, this is a whitespace error according to `git diff --check`; on the other hand, the raw documentation—it makes no difference in the rendered output—is just staying faithful to the simulation of the interactive prompt. Let’s get rid of these whitespace errors and also make the examples more friendly to cut-and-paste by replacing the heredocs with files which are shown with cat(1). [1]: dfd66ddf5a (Documentation: add documentation for 'git interpret-trailers', 2014-10-13) Suggested-by: Junio C Hamano Signed-off-by: Kristoffer Haugsbakk --- Documentation/git-interpret-trailers.txt | 74 +++++++++++------------- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt index 22ff3a603e..15d34b983f 100644 --- a/Documentation/git-interpret-trailers.txt +++ b/Documentation/git-interpret-trailers.txt @@ -326,13 +326,12 @@ $ git config trailer.sign.key "Signed-off-by: " $ git config trailer.sign.ifmissing add $ git config trailer.sign.ifexists doNothing $ git config trailer.sign.command 'echo "$(git config user.name) <$(git config user.email)>"' -$ git interpret-trailers < EOF +$ git interpret-trailers -$ git interpret-trailers < Signed-off-by: Alice -> EOF +$ cat msg.txt +Signed-off-by: Alice +$ git interpret-trailers ------------ @@ -357,15 +356,14 @@ Fix #42 $ cat ~/bin/glog-find-author #!/bin/sh test -n "$1" && git log --author="$1" --pretty="%an <%ae>" -1 || true +$ cat msg.txt +subject + +message $ git config trailer.help.key "Helped-by: " $ git config trailer.help.ifExists "addIfDifferentNeighbor" $ git config trailer.help.cmd "~/bin/glog-find-author" -$ git interpret-trailers --trailer="help:Junio" --trailer="help:Couder" < subject -> -> message -> -> EOF +$ git interpret-trailers --trailer="help:Junio" --trailer="help:Couder" $ cat ~/bin/glog-grep #!/bin/sh test -n "$1" && git log --grep "$1" --pretty=reference -1 || true +$ cat msg.txt +subject + +message $ git config trailer.ref.key "Reference-to: " $ git config trailer.ref.ifExists "replace" $ git config trailer.ref.cmd "~/bin/glog-grep" -$ git interpret-trailers --trailer="ref:Add copyright notices." < subject -> -> message -> -> EOF +$ git interpret-trailers --trailer="ref:Add copyright notices." subject -> -> message -> -> see: HEAD~2 -> EOF +$ git interpret-trailers commit_template.txt < ***subject*** -> -> ***message*** -> -> Fixes: Z -> Cc: Z -> Reviewed-by: Z -> Signed-off-by: Z -> EOF +$ cat temp.txt +***subject*** + +***message*** + +Fixes: Z +Cc: Z +Reviewed-by: Z +Signed-off-by: Z +$ sed -e 's/ Z$/ /' temp.txt > commit_template.txt $ git config commit.template commit_template.txt -$ cat >.git/hooks/commit-msg < #!/bin/sh -> git interpret-trailers --trim-empty --trailer "git-version: \$(git describe)" "\$1" > "\$1.new" -> mv "\$1.new" "\$1" -> EOF +$ cat .git/hooks/commit-msg +#!/bin/sh +git interpret-trailers --trim-empty --trailer "git-version: \$(git describe)" "\$1" > "\$1.new" +mv "\$1.new" "\$1" $ chmod +x .git/hooks/commit-msg ------------ From patchwork Wed Apr 12 19:52:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristoffer Haugsbakk X-Patchwork-Id: 13209484 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2917CC77B6E for ; Wed, 12 Apr 2023 19:58:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbjDLT57 (ORCPT ); Wed, 12 Apr 2023 15:57:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjDLT55 (ORCPT ); Wed, 12 Apr 2023 15:57:57 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66CF52683 for ; Wed, 12 Apr 2023 12:57:56 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C8FAF5C00C0; Wed, 12 Apr 2023 15:57:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 12 Apr 2023 15:57:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=khaugsbakk.name; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1681329475; x= 1681415875; bh=KXveMsDAkaiOnJpaM7E0oI/dVYCNQgIkiXQqtqweezE=; b=S S1p45Qu7rZk3gA/GNC+w8xmyokANCkKWPIYetzkV8YQc4GIScsGTXaVC+hfoNdKl lzpKEh3QUGR6U36mfqM074Ucba0FqFpRE3n/idnia1VQBDvucVnYan2mMdpPoiv1 414XHNBC5s73I7bHP5jwcv2OVLC57k2WqcvGDyOiFgcygBH6fPQEBM8jhEbFAxAT y1Pclw6q7tX3/lyt0ly/7M52HooxjdoPVqcAdMjzUhQ1VnOglapxk1j1fUBEoiE8 BtQ4JFetPOYRGqCQAUv/VrVMvnoX5qKvLa8dwD8dJwCxXe6G4w8w/UXV/zcBTJJN CtzCUd6S9alpqArHG51hw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1681329475; x= 1681415875; bh=KXveMsDAkaiOnJpaM7E0oI/dVYCNQgIkiXQqtqweezE=; b=H 2UmmTWfA9FFgjB9tAhTlXUiCaJVrzl8fqnBA8zzA5F/F4rNQUjavmvceFnp+62Ui LBq0xim3S8RZCm4lwPWeoak69t9uVjkFX9RlC0Q4TTxuecF45VpRAv7q31p/RGUX ftBVFe9F5V+F9k1raCETg4x2bFBEkbLaKJMbLcUCa2ds8ej/Fkkv1H0UPh8iff/8 K7UmEUA02aLY3CH67voWsZXjACWqEpxCRhc4SdJeyII+0s8qKORb4aOv9AqGYZ57 47CuP+cjZYAeWrANkTnR0b6A7xhY/V1kB5ZiJXytp7wODS3k6/MniY58QbGc9UXr DRhcqNu7Xc2XZd7bd7Xpg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdekiedgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhgggfestd ekredtredttdenucfhrhhomhepmfhrihhsthhofhhfvghrucfjrghughhssggrkhhkuceo tghouggvsehkhhgruhhgshgsrghkkhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpefhud evveejtddttedvhfelffeuuefhffeugeeluedtgfdtuefhtefhudelleekteenucffohhm rghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomheptghouggvsehkhhgruhhgshgsrghkkhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Apr 2023 15:57:54 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , adlternative@gmail.com, christian.couder@gmail.com, Junio C Hamano Subject: [PATCH v3 2/4] doc: interpret-trailers: use input redirection Date: Wed, 12 Apr 2023 21:52:13 +0200 Message-Id: <12f7b10462184cbac884859e91d7b45e021041ee.1681326818.git.code@khaugsbakk.name> X-Mailer: git-send-email 2.40.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Suggested-by: Junio C Hamano Signed-off-by: Kristoffer Haugsbakk --- Notes (series): Link: https://lore.kernel.org/git/xmqqbkk44qbo.fsf@gitster.g/ Documentation/git-interpret-trailers.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt index 15d34b983f..6b712564a4 100644 --- a/Documentation/git-interpret-trailers.txt +++ b/Documentation/git-interpret-trailers.txt @@ -280,7 +280,7 @@ $ cat msg.txt subject message -$ cat msg.txt | git interpret-trailers --trailer 'sign: Alice ' --trailer 'sign: Bob ' +$ git interpret-trailers --trailer 'sign: Alice ' --trailer 'sign: Bob ' X-Patchwork-Id: 13209485 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43FB2C7619A for ; Wed, 12 Apr 2023 19:58:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229820AbjDLT6e (ORCPT ); Wed, 12 Apr 2023 15:58:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbjDLT6c (ORCPT ); Wed, 12 Apr 2023 15:58:32 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E248D3 for ; Wed, 12 Apr 2023 12:58:31 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id AB1205C00CC; Wed, 12 Apr 2023 15:58:30 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 12 Apr 2023 15:58:30 -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:sender:subject:subject:to:to; s=fm2; t=1681329510; x=1681415910; bh=Z/9eJg4mSH/W4d14sZnnZe9Uc M00AmOa2B7xhBAxaXQ=; b=wlTiahvH6ahT7n7g12XvzBQ+QUmV1R+p5I/1Md7dV FgBhMnCxgJojt7Trf87pJwzmkZtCY321ddNpWiOx4u6Ahg7701QfODNIG+qaskZU G8FNz28Cjkf8kA7Hx0khJigUJyK9QJpyAF5g7H+cli/7rsbUcqp91AdtQcgtZqEB kSlzn2v8cuHVXLItoqmHatb30a4SVHwtk7O0TYvn0L/VxCLqX2LSHjk7C0SDOtmI tS9x10i8QaYSFdiwLMn5p9n9k6P+rGLWV1as5k2iX02zB4rfhbjj3koDK0Ei4Asg ciM9X+rgg/15/n9Fv7VFXnsMK7l1snHKSQy/JuEKnOviw== 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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1681329510; x=1681415910; bh=Z/9eJg4mSH/W4d14sZnnZe9UcM00AmOa2B7 xhBAxaXQ=; b=K1+1vSjSRNRGFhGyRAr3EEKMmP4YEIz4ZdBBZ684t/zaOA+ZyOU BRGRFW7rCBQsBCvRVUQqXocVYTQ/+AeGThBeb0+/sClKOTBc4TuP8+JHX4828L/1 PjdSOe3V/XCueBGEJccKT3h1rRSR2cl898oJozNPSjtMcd+6j9eFAkeeFb/ZjnZS a5+xxmZVoYU6pK8Dg3exDSD9oaU2zS35uTVZzd+cPo5mfbc5N+VNPbBbVu83WCXH pKJkngMtS4jIxgyrI50eH4ZWuot/KDTgDsZNWEjLgIzRnoXVbilcLjhh5d/NhzJB 4Tun2x4Ga6m7k2HuRkIRX7vsp+ZSCAwE93Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdekiedgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhggtgfgse htkeertdertdejnecuhfhrohhmpefmrhhishhtohhffhgvrhcujfgruhhgshgsrghkkhcu oegtohguvgeskhhhrghughhssggrkhhkrdhnrghmvgeqnecuggftrfgrthhtvghrnhepve fgleevieekgeejieekueevhfelieduvdelgeefkeejtdekvedttefgffevtedtnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheptghouggvsehkhh gruhhgshgsrghkkhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Apr 2023 15:58:29 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , adlternative@gmail.com, christian.couder@gmail.com Subject: [PATCH v3 3/4] =?utf-8?q?doc=3A_interpret-trailers=3A_don=E2=80=99t?= =?utf-8?q?_use_deprecated_config?= Date: Wed, 12 Apr 2023 21:52:14 +0200 Message-Id: X-Mailer: git-send-email 2.40.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org `command` has been deprecated since commit c364b7ef51 (trailer: add new .cmd config option, 2021-05-03). Use the commit message of c364b7ef51 as a guide to replace the use of `$ARG` and to use a script instead of an inline command.[1] Also, explicitly trigger the command by passing in `--trailer=see`, since this config is not automatically used.[2] [1]: “Instead of "$ARG", users can refer to the value as positional argument, $1, in their scripts.” [2]: “At the same time, in order to allow `git interpret-trailers` to better simulate the behavior of `git command -s`, 'trailer..cmd' will not automatically execute.” Acked-by: ZheNing Hu Signed-off-by: Kristoffer Haugsbakk --- Documentation/git-interpret-trailers.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt index 6b712564a4..d2a23e9161 100644 --- a/Documentation/git-interpret-trailers.txt +++ b/Documentation/git-interpret-trailers.txt @@ -325,7 +325,7 @@ $ git interpret-trailers --trailer 'Cc: Alice ' --trailer 'Re $ git config trailer.sign.key "Signed-off-by: " $ git config trailer.sign.ifmissing add $ git config trailer.sign.ifexists doNothing -$ git config trailer.sign.command 'echo "$(git config user.name) <$(git config user.email)>"' +$ git config trailer.sign.cmd 'echo "$(git config user.name) <$(git config user.email)>"' $ git interpret-trailers @@ -405,11 +405,14 @@ subject message see: HEAD~2 +$ cat ~/bin/glog-ref +#!/bin/sh +git log -1 --oneline --format="%h (%s)" --abbrev-commit --abbrev=14 $ git config trailer.see.key "See-also: " $ git config trailer.see.ifExists "replace" $ git config trailer.see.ifMissing "doNothing" -$ git config trailer.see.command "git log -1 --oneline --format=\"%h (%s)\" --abbrev-commit --abbrev=14 \$ARG" -$ git interpret-trailers X-Patchwork-Id: 13209486 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFD26C7619A for ; Wed, 12 Apr 2023 19:58:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229848AbjDLT6m (ORCPT ); Wed, 12 Apr 2023 15:58:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbjDLT6k (ORCPT ); Wed, 12 Apr 2023 15:58:40 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA36A65A7 for ; Wed, 12 Apr 2023 12:58:37 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 506E55C00CE; Wed, 12 Apr 2023 15:58:37 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 12 Apr 2023 15:58:37 -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:sender:subject:subject:to:to; s=fm2; t=1681329517; x=1681415917; bh=7EmVg5LaMS55PHupRNLqYaRMJ t51wP017vloNVEO+Vc=; b=TiWoe1e3nfidGHVd8Nm6eWp1Q2ylyG6CBv2XoJHlP grEDhS48B0JEuUj9srO4oMtjndQUOlc7M1OZwtSNslX+U6JvivGN4gLakPmCFIjT RCP+lSg5bPHYwkbP1jpF9HEbVRoe8x9uMOwRzvYZOmU/nnp5uR68YQiP/JWlsaU5 zcGaInC6H4p3NqTEZLYibPpdis2JUH+jjKSy1tYjfvXL6LiAvsvdVEreVrL70kdp f15gmJsvQAw5+opn34fLhJ1NEmOgMvmy2fb/5zH71OyC9IGQGwi9igc6BcBt58GG BdCxLj/FQaKvUQ5l0/PewU7DTkj9pv1Cs7JeTIu8s9LhQ== 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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1681329517; x=1681415917; bh=7EmVg5LaMS55PHupRNLqYaRMJt51wP017vl oNVEO+Vc=; b=ZDQep+eEiDQYjok4qQOQBcI6q+msAmCiTzacSc4tgovNDBDyNkV I5L9Qp+hJxuUfOOrojXt2GKaqbqVi/r4cByGkNhaXFI8dE5zzV5veGfOpNR4Yqr/ f2vu/UfB19Zg/f3re6mPJ6MibiUTUCwSRbQGhGc2kxjMvq/TkXvf+/O7XC0qOZGB IDwnLZ77NqQD9jS30ZvIKiw31RGx6mCPjDHojAIlqfn5XgrYCxOcByN5rnlfYogM CihY4xxv+jHRzhaoI0dvl0SfxW/93pZ4whZZAaLj2qyNOHGV7zwyN1QPgFnTzFiq GftClEf/Xgsrz9nPN0DPAsijg/aqiBT96QA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdekiedgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhggtgfgse htkeertdertdejnecuhfhrohhmpefmrhhishhtohhffhgvrhcujfgruhhgshgsrghkkhcu oegtohguvgeskhhhrghughhssggrkhhkrdhnrghmvgeqnecuggftrfgrthhtvghrnhepve fgleevieekgeejieekueevhfelieduvdelgeefkeejtdekvedttefgffevtedtnecuvehl uhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomheptghouggvsehkhh gruhhgshgsrghkkhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Apr 2023 15:58:36 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , adlternative@gmail.com, christian.couder@gmail.com Subject: [PATCH v3 4/4] doc: interpret-trailers: fix example Date: Wed, 12 Apr 2023 21:52:15 +0200 Message-Id: X-Mailer: git-send-email 2.40.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org We need to provide `--trailer sign` since the command won’t output anything if you don’t give it an input and/or a `--trailer`. Furthermore, the message which already contains an s-o-b is wrong: $ git interpret-trailers --trailer sign Signed-off-by: Alice This can’t be what was originally intended. So change the messages in this example to use the typical “subject/message” file. Signed-off-by: Kristoffer Haugsbakk --- Documentation/git-interpret-trailers.txt | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt index d2a23e9161..4b97f812be 100644 --- a/Documentation/git-interpret-trailers.txt +++ b/Documentation/git-interpret-trailers.txt @@ -322,16 +322,30 @@ $ git interpret-trailers --trailer 'Cc: Alice ' --trailer 'Re 'Signed-off-by: ' already, and show how it works: + ------------ +$ cat msg1.txt +subject + +message $ git config trailer.sign.key "Signed-off-by: " $ git config trailer.sign.ifmissing add $ git config trailer.sign.ifexists doNothing $ git config trailer.sign.cmd 'echo "$(git config user.name) <$(git config user.email)>"' -$ git interpret-trailers -$ cat msg.txt +$ cat msg2.txt +subject + +message + Signed-off-by: Alice -$ git interpret-trailers ------------