From patchwork Mon May 1 20:02:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kristoffer Haugsbakk X-Patchwork-Id: 13228261 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 EDA80C77B73 for ; Mon, 1 May 2023 20:05:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233005AbjEAUFg (ORCPT ); Mon, 1 May 2023 16:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232987AbjEAUFf (ORCPT ); Mon, 1 May 2023 16:05:35 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B56D26B6 for ; Mon, 1 May 2023 13:05:34 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 7C1E632009A0; Mon, 1 May 2023 16:05:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 01 May 2023 16:05:33 -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=1682971533; x=1683057933; bh=MZf/MG3lv1cPp1JWbPT3Wnumx JACiJ+LvMo0ocy68jo=; b=eDVdwdzsOJxnghoR4qjZun9IIoJDCEEgB7nHO2gOP W15CLiL8pzf60n1V15hsyt9YyK2J2nk6LmV+EfQpMPjuunBBX737yb8NHPFqhCUb Wc6MLyrZ7SgJa7DWxYEeWwY081LybGvpvs+e9wwtDQkAFkJorFo8pA7oZB3XgVZl Jz5SSdrANh+QKTfeTt66aX2VPRWC+JjVgb2lk2T+JNAYQCtP5AyvHdAINOzJ/77H Kjz125K/M/c2xKmtP/3cpcukoLgy7pbzbS6qFgameeX8JNRtCrYjG829yq4oMD1c CT+gpqGgozcVxAPRy9cB+nUWygbQ0cdcXnbsl+Bp2XcGg== 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= 1682971533; x=1683057933; bh=MZf/MG3lv1cPp1JWbPT3WnumxJACiJ+LvMo 0ocy68jo=; b=J0el/Hd5lcwdnTnSn0eLyvzxenB3zz+CYEaxjDhbfdiBxaOY0HP tXMvZO490RJGKU+SuvZqiNSWB8MQ2f0IUmI6aTHjxAY7AvVk8vPs6AZbYcwgCIMa l/l14RdLnlvbBZqiEXbeAi9vUEtHS1E4BfxL8212UaMufDeQlF1QSjLEBOOne2Ow ypFy07HLGjEC16LfXOTQ821DucTFFFo8t58Jzb9nHd9rBnJNQm8lZ14tAz9d+0pf YouCUP+37yNYEmuAcQdpksTqfopKBKw+CootVIo0aNBve9F/c2XKHlYKfsjB+bve Af3GyO1+yn17v3Z94y+1gcovgCH6jX5qJPg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedvgedgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhggtgfgse htkeertdertdejnecuhfhrohhmpefmrhhishhtohhffhgvrhcujfgruhhgshgsrghkkhcu oegtohguvgeskhhhrghughhssggrkhhkrdhnrghmvgeqnecuggftrfgrthhtvghrnhepve fgleevieekgeejieekueevhfelieduvdelgeefkeejtdekvedttefgffevtedtnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheptghouggvsehkhh gruhhgshgsrghkkhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 1 May 2023 16:05:32 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , Junio C Hamano Subject: [PATCH v4 1/4] =?utf-8?q?doc=3A_interpret-trailers=3A_don=E2=80=99t?= =?utf-8?q?_use_heredoc_in_examples?= Date: Mon, 1 May 2023 22:02:38 +0200 Message-Id: <149dcf964cb0ff056b8bb454602b07b316725400.1682970213.git.code@khaugsbakk.name> X-Mailer: git-send-email 2.40.1 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..4f4eb7a7fc 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 Mon May 1 20:02:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristoffer Haugsbakk X-Patchwork-Id: 13228262 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 5FC10C77B73 for ; Mon, 1 May 2023 20:05:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232740AbjEAUFn (ORCPT ); Mon, 1 May 2023 16:05:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233135AbjEAUFl (ORCPT ); Mon, 1 May 2023 16:05:41 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C78821707 for ; Mon, 1 May 2023 13:05:40 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 2C4463200392; Mon, 1 May 2023 16:05:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 01 May 2023 16:05:40 -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=1682971539; x= 1683057939; bh=tGIxcmWDFNtNc2K2H3m7LkQpAtz7EbGLGzBKRBxYgTk=; b=g 75ExpgLwm1Xrm5IZA5ISOP0mzx+YSSMxtyoHSrmJeDuV6zZBAbxo3DT/5+/nIBht ADRO4tJVW6L0O1aJTpoXGGGcUNuI6dNQZdHTe8SDdJlkCa5SZmBCRiKHwtC4s/Nr F+Pod/xRP4S3sLI27qvFQuojZPxKe0Y9Z4L/5EZM47siIWmQqwWAX0wdhVG5HKvG jG4cvmv8npudPROKEpKrJDRlRxObRWGQFfrh117p3gEJzH3dKpjlw9cWOp/Udqpu 13mcM0hk42DQonO4NsvIzihAfwew5HZ+rrnl5JFiZ+n00boJmiriCmmi5poUV7+/ EP/gooX7qI5R085f/debA== 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=1682971539; x= 1683057939; bh=tGIxcmWDFNtNc2K2H3m7LkQpAtz7EbGLGzBKRBxYgTk=; b=P uqIFey2DN0MDrWxHbPbB/H49w3+IQlba9lP2yP3m1/JEI3dDTKr4YMHezqz4niAP Po0cVokuGEFyEY1F33wLuxJlUXx4iPTv1goP2aTOiis0QrNaIGZMmyV7QsYHtMqS 8CVcWL98wkgenOIBx//LhVjHGeQLbI6bic67MHlO8FlC/Dyfv7+Yq3X3aRYrAq3J 7UzAtA4fe12lzuKnfgn2OLR6X/TTccTfypDybI07yjjRqLgK6kta2hnoAjFU4DN8 Y289bYIUQQ8J0ujAPcACcP9dxXGGhmeXJQCuP+7JqIFO99vhXH22sMEd3+lGZIVA Mdots5TcIZkZE+zaNImSw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedvgedgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhgggfestd ekredtredttdenucfhrhhomhepmfhrihhsthhofhhfvghrucfjrghughhssggrkhhkuceo tghouggvsehkhhgruhhgshgsrghkkhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpefhud evveejtddttedvhfelffeuuefhffeugeeluedtgfdtuefhtefhudelleekteenucffohhm rghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomheptghouggvsehkhhgruhhgshgsrghkkhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 1 May 2023 16:05:38 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , Junio C Hamano Subject: [PATCH v4 2/4] doc: interpret-trailers: use input redirection Date: Mon, 1 May 2023 22:02:39 +0200 Message-Id: <32483aa635a61283c3c901c4705e531c9736209b.1682970213.git.code@khaugsbakk.name> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Use input redirection instead of invoking cat(1) on a single file. This is more straightforward, saves a process, and often makes the line shorter. Suggested-by: Junio C Hamano Signed-off-by: Kristoffer Haugsbakk --- Notes (series): Junio suggested expanding the commit message: https://lore.kernel.org/git/xmqqjzyg7qdw.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 4f4eb7a7fc..4ff8be7f2e 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: 13228263 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 2D7E7C77B73 for ; Mon, 1 May 2023 20:05:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233148AbjEAUFw (ORCPT ); Mon, 1 May 2023 16:05:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232715AbjEAUFu (ORCPT ); Mon, 1 May 2023 16:05:50 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B7A22685 for ; Mon, 1 May 2023 13:05:49 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id E6F2E320099F; Mon, 1 May 2023 16:05:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 01 May 2023 16:05:49 -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=1682971548; x=1683057948; bh=PBJwvj4/7rMiKOK6yU58ocax7 4D1zxG609oYSSATl+w=; b=a9/VoLtfonfkj5HivhaPOnpa7nFT7jFe3BsIfkt5Q JoSieoeuN4+s13HSBHVYqFyB/840MTObNOWdQNGZOl5vB9ymwKSaJfbir20Abvh2 gZlZ70t730gDi4i+0Lymok9dDiSM/Raq15BMOtpSdmKXxy+PHTDEmTLYRQe4wM+F 5rcDGKSYFUn8H2pc3TF+pn7xctYtn13MJ7Uy2klXHXHtB84OrdJ+N4pgoZ6bc0Pc UvrRZDa12bKoHABvIZOsOPbk62P3jzSB0siET8rhryt3npF/pMT8LELMkxzpO0go 8IKl/mDtd9OZP6O/59zb8o4vtmbKGlLSS7b2B/tqNb7tw== 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= 1682971548; x=1683057948; bh=PBJwvj4/7rMiKOK6yU58ocax74D1zxG609o YSSATl+w=; b=FzUhPkZ3WULN3t59nf0XmLhPyx6pQx4rRn5UbU/izrqEduuQR2a jvS2F4Rd1yXTZO6cE/JQDebheGzmThgtsEFGAcz7AHo0kWK3pk7uSFUuwy+eMard wly9sJCTc4qDLNxb3JevWXUiR80Si3TILftI7n3xkzXkdlyHGxPlrmqbIL1oV36c o+dJJIEQSfRoZeN3kK3FxPTySzjiI3893S9IuUuS1P1RenpCpI9yV7jeIG9zwJcb sqlN1VUcRE9WFPlQLGiGekes7XRgJ2wgeHOwFpj2mW26HiQZRS6t3ZlweRQuJSEt 84z+HuvGniLNvorvQB09OXkuHYnhgOazQwg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedvgedgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhggtgfgse htkeertdertdejnecuhfhrohhmpefmrhhishhtohhffhgvrhcujfgruhhgshgsrghkkhcu oegtohguvgeskhhhrghughhssggrkhhkrdhnrghmvgeqnecuggftrfgrthhtvghrnhepve fgleevieekgeejieekueevhfelieduvdelgeefkeejtdekvedttefgffevtedtnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheptghouggvsehkhh gruhhgshgsrghkkhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 1 May 2023 16:05:47 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , ZheNing Hu Subject: [PATCH v4 3/4] =?utf-8?q?doc=3A_interpret-trailers=3A_don=E2=80=99t?= =?utf-8?q?_use_deprecated_config?= Date: Mon, 1 May 2023 22:02:40 +0200 Message-Id: <9ea4c4f91673af53985aac04e93e5f46d9508fde.1682970213.git.code@khaugsbakk.name> X-Mailer: git-send-email 2.40.1 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 4ff8be7f2e..acecc037ec 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: 13228264 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 DA023C77B7C for ; Mon, 1 May 2023 20:06:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233110AbjEAUGB (ORCPT ); Mon, 1 May 2023 16:06:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233018AbjEAUFx (ORCPT ); Mon, 1 May 2023 16:05:53 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D036A2685 for ; Mon, 1 May 2023 13:05:52 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 44B77320094F; Mon, 1 May 2023 16:05:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 01 May 2023 16:05:52 -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=1682971551; x=1683057951; bh=Ha/vK0aQTChyGt/tMU53E4y/s LamF/w4nZzn7hoC2uk=; b=Ph50aPAc2K6ZWrJbQBqmlf4yhzMBZE44OL5icjwIT XjPPo9G+4Ic4B/AFW2Lm9QvwleLjdafVJLYLMO9KI/cjovbSO9a4JERX2Gu1/52R ucS4UEPxP2yC7ABPBNQyOZvpDlr6uCJK0K4isPyjuzUVdYDALp9390zjThh5zA/6 I5ZGc1aVZC8oOW36ruEKnhY2dOEj4omVPhcVNMwuPFWAwPET9moR2V5xQjLOcCHX oTW4763DiUV9JsuIbREG2xMDtujX1YaI1rMpRbUJy5jO0teLqe2GYuSzhCoOJQLt LV0jamC9jCIhWueEL6AEDOsJbFlA6osL/iHztckzP4SJA== 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= 1682971551; x=1683057951; bh=Ha/vK0aQTChyGt/tMU53E4y/sLamF/w4nZz n7hoC2uk=; b=JIlXfdG3iHZReDD3MNbBtngZiezRXe/V55MPOacDqIZCqUe9Njd ps0lZooleiBbF7dM/2yDd9K7H9Dzw/YM1uiyPAkYO8nwxRVhNG0N8ah9jPNQk+f8 TZIoTmosXG7D6QfsmW5KwzVakluzfFH5a2og1bbZB+KsNHf3Jk3mkknafcHd/3lo tcdEcMEP2T4bqPZIzOWNoMksDxZceXaLbo63TS8hAh0W93nVoL3JGZPry/1BWcMn K1Yalhj/QWPDDa8gIZCCqQyzl35v7UusxmLJlIA/FEgWotSNxBcSNmulADw+wRm2 1fD/x0pR2SrEduJMay09RsTtwW+DpEclpvg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedvgedgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhggtgfgse htkeertdertdejnecuhfhrohhmpefmrhhishhtohhffhgvrhcujfgruhhgshgsrghkkhcu oegtohguvgeskhhhrghughhssggrkhhkrdhnrghmvgeqnecuggftrfgrthhtvghrnhepve fgleevieekgeejieekueevhfelieduvdelgeefkeejtdekvedttefgffevtedtnecuvehl uhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomheptghouggvsehkhh gruhhgshgsrghkkhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 1 May 2023 16:05:51 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk Subject: [PATCH v4 4/4] doc: interpret-trailers: fix example Date: Mon, 1 May 2023 22:02:41 +0200 Message-Id: <95760aafe86315c67115e4152e9ea98737de8c9e.1682970213.git.code@khaugsbakk.name> X-Mailer: git-send-email 2.40.1 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 acecc037ec..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 ------------