From patchwork Mon Apr 3 19:21:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kristoffer Haugsbakk X-Patchwork-Id: 13198616 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 B0CD2C76196 for ; Mon, 3 Apr 2023 19:24:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231411AbjDCTYG (ORCPT ); Mon, 3 Apr 2023 15:24:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbjDCTYF (ORCPT ); Mon, 3 Apr 2023 15:24:05 -0400 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFD11E7C for ; Mon, 3 Apr 2023 12:24:03 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 311123200495; Mon, 3 Apr 2023 15:24:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 03 Apr 2023 15:24:03 -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=fm1; t=1680549842; x=1680636242; bh=W+EDktMXHs9yOLuVKaVrlVXPm hLb9jlE3pxfmyEbKc4=; b=j8FtfaY7OdRx04QLHJrxacbWun4aHNQXAC1O2Ee2H aRcQjli+kQg05X5W8ymG4IMJvmikmtAhZwDw2Hux9mq0PZlcxLQUj3zg/BbP/rhL MFZFBxvb0tCSur05PrNI4JYaFKuW2YjTr5+sORij2gPe/oKjoOF+z2nfGcuYNaqY 1n63pkfhyEAFC1yBsesCaX33kmDwFr2cVDH8b1xc1cYFUSTe5cbDkkTWeEOeKQ/Q aLlwruys1Wkn0ScDGnmpGAgx6H9cUZPn7Msme8NXZWyPqh/BeWccL6CWAVakpHT9 9yui00UK5RXWAOL/mR0myPcoqFXV0+VMoT+liNJxbd07w== 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=fm2; t= 1680549842; x=1680636242; bh=W+EDktMXHs9yOLuVKaVrlVXPmhLb9jlE3px fmyEbKc4=; b=RSmzrtKyk30ojyc6NqIIUy7BRpdaXJz+uQ8XoQW1ZwPvMpmDeeA HXoLVP1mvD9zw61AAnIY4+s+1qVVA3e0debq1BNmoSA40cmxUlb1c89Q4XUlcgFB +zdArqJ8j0aaPSSb1T4zpy2kleoS7V6HSX5bAECVQ3J/TN2VXqRPYseMGFzQsNZx bmIkxIqdEI3R+nuyeb28KJzQDLoKwiG349E4bDzIu5dTIxw9GZlAvJNQRLsvGRIE 12jgJS8kthgEaqRmoOra1C3k1rk5cGs1TeuyX6NmFYZa3fSKOzXCNmU3dbpOBSUO ZX+8sz1S3yq3LPsNYmNhlBxojieuRHAEU3Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeijedgudefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhggtgfgse htkeertdertdejnecuhfhrohhmpefmrhhishhtohhffhgvrhcujfgruhhgshgsrghkkhcu oegtohguvgeskhhhrghughhssggrkhhkrdhnrghmvgeqnecuggftrfgrthhtvghrnhepue eiueffuefftefhhfefleelhfeuheettedtheevgeejteehgfevffeugffglefhnecuffho mhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpegtohguvgeskhhhrghughhssggrkhhkrdhnrghmvg X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 3 Apr 2023 15:24:01 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , rybak.a.v@gmail.com, Junio C Hamano , Christian Couder Subject: [PATCH v2 1/3] =?utf-8?q?doc=3A_interpret-trailers=3A_don=E2=80=99t?= =?utf-8?q?_use_heredoc_in_examples?= Date: Mon, 3 Apr 2023 21:21:59 +0200 Message-Id: <38f9a4bdf89f854c30a7b708e955e2089b031c13.1680548650.git.code@khaugsbakk.name> X-Mailer: git-send-email 2.40.0 In-Reply-To: References: <20230331181229.15255-1-code@khaugsbakk.name> 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 Cc: Christian Couder Signed-off-by: Kristoffer Haugsbakk --- Notes (series): This was one of the suggestions by Junio[1] > Showing with a separate intermediate file, i.e. > [snip] > might make the result slightly easier to follow. I dunno. [1]: https://lore.kernel.org/git/xmqqsfdkep2b.fsf@gitster.g/ Documentation/git-interpret-trailers.txt | 72 +++++++++++------------- 1 file changed, 33 insertions(+), 39 deletions(-) diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt index 22ff3a603e..dbbb6815c3 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 +$ cat empty-msg.txt | git interpret-trailers Signed-off-by: Bob -$ git interpret-trailers < Signed-off-by: Alice -> EOF +$ cat msg.txt +Signed-off-by: Alice +$ cat msg.txt | git interpret-trailers Signed-off-by: Alice ------------ @@ -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 +$ cat msg.txt | git interpret-trailers --trailer="help:Junio" --trailer="help:Couder" subject message @@ -382,15 +380,14 @@ Helped-by: Christian 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 +$ cat msg.txt | git interpret-trailers --trailer="ref:Add copyright notices." subject message @@ -402,17 +399,15 @@ Reference-to: 8bc9a0c769 (Add copyright notices., 2005-04-07) commit that is related, and show how it works: + ------------ +$ cat msg.txt +subject + +message $ 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 < subject -> -> message -> -> see: HEAD~2 -> EOF +$ cat msg.txt | git interpret-trailers subject message @@ -427,22 +422,21 @@ See-also: fe3187489d69c4 (subject of related commit) to add a 'git-version' trailer: + ------------ -$ sed -e 's/ Z$/ /' >commit_template.txt < ***subject*** -> -> ***message*** -> -> Fixes: Z -> Cc: Z -> Reviewed-by: Z -> Signed-off-by: Z -> EOF +$ cat commit_template.txt +***subject*** + +***message*** + +Fixes: Z +Cc: Z +Reviewed-by: Z +Signed-off-by: Z +$ sed --in-place -e 's/ Z$/ /' 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 Apr 3 19:22:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kristoffer Haugsbakk X-Patchwork-Id: 13198626 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 A800EC76196 for ; Mon, 3 Apr 2023 19:24:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231497AbjDCTYT (ORCPT ); Mon, 3 Apr 2023 15:24:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231357AbjDCTYR (ORCPT ); Mon, 3 Apr 2023 15:24:17 -0400 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B5AF2120 for ; Mon, 3 Apr 2023 12:24:16 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 128D332009ED; Mon, 3 Apr 2023 15:24:15 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 03 Apr 2023 15:24:15 -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=fm1; t=1680549854; x=1680636254; bh=DbnH6bGRPP/YtDhi2vh45Wj97 1So9fIb1sBG7ZnysOc=; b=eAADgxDZW4jUOkuOG4fU4+y/Syhz5w5R7Hxy2CSTR 5fp3B9kTwhIplpyVjzEeeduPrfeVlTvKDYclzCKlGiMVkHaVhPIu0nBBbdmMbZoP s14Mf5C+XXdld6504vP+qu2g9Y6LsEFOuJgiDLkgglgeoJX/ZMgr15jRkpaEOcMN 5OVwTZ/YV0DrmV6o07zkKea9F2ysX7tLu8yk/dV45KAXNYH/vdqNOt1blArZa09x hKn/MPQBRRJWlSimeM9dooRqsAyoBSDJxA5H17Ncd2IobIT1CSO7SVZtSL3SlYma UrlrUPZa++oSvm0iIXhSfG4USixxTgcNdGlQGedA1OuiA== 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=fm2; t= 1680549854; x=1680636254; bh=DbnH6bGRPP/YtDhi2vh45Wj971So9fIb1sB G7ZnysOc=; b=dn0J6cs1bocUzQc1ZWl1JIgd3ejAyp9Kdd7hnUfJJQIt/qSSwXa 8aR42VZTm3pgFkJlFlsLwfbQUDA9m/qARWBI8v8RsdziGVKAHg5f+1TNgt7XaXnc yU/ZVC0kOY5w419vgBXJueMLj9lrZoCNqmv+fAuPTu4Y8f4WxRWgVMW7Iv2rwCvL mkHi/2th+aX+ck4yvhWIQcmq0wY1tHBR9aeQat+xr6RL7HmQvMXU+vO2PrM4Xw62 uUM/jLh5CNrFBafKNam0yPFaGVMkiuPq7cdPu2uYPxPZtZL9TDteLoDh0SNq4ReN 0lgyIcMjh9GQZ1IlQMkqmLeG8TvdFaXaMhw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeijedgudefkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhggtgfgse htkeertdertdejnecuhfhrohhmpefmrhhishhtohhffhgvrhcujfgruhhgshgsrghkkhcu oegtohguvgeskhhhrghughhssggrkhhkrdhnrghmvgeqnecuggftrfgrthhtvghrnhepve fgleevieekgeejieekueevhfelieduvdelgeefkeejtdekvedttefgffevtedtnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheptghouggvsehkhh gruhhgshgsrghkkhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 3 Apr 2023 15:24:13 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , rybak.a.v@gmail.com, ZheNing Hu Subject: [PATCH v2 2/3] =?utf-8?q?doc=3A_interpret-trailers=3A_don=E2=80=99t?= =?utf-8?q?_use_deprecated_config?= Date: Mon, 3 Apr 2023 21:22:00 +0200 Message-Id: X-Mailer: git-send-email 2.40.0 In-Reply-To: References: <20230331181229.15255-1-code@khaugsbakk.name> 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.” Cc: 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 dbbb6815c3..c76efae76a 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)>"' $ cat empty-msg.txt | git interpret-trailers Signed-off-by: Bob @@ -403,11 +403,14 @@ $ cat msg.txt subject message +$ 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" -$ cat msg.txt | git interpret-trailers +$ git config trailer.see.cmd "glog-ref" +$ cat msg.txt | git interpret-trailers --trailer=see subject message From patchwork Mon Apr 3 19:22:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kristoffer Haugsbakk X-Patchwork-Id: 13198627 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 14668C76196 for ; Mon, 3 Apr 2023 19:24:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231786AbjDCTY0 (ORCPT ); Mon, 3 Apr 2023 15:24:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231357AbjDCTYZ (ORCPT ); Mon, 3 Apr 2023 15:24:25 -0400 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 403ABE7C for ; Mon, 3 Apr 2023 12:24:24 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 7D7DB32001FC; Mon, 3 Apr 2023 15:24:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 03 Apr 2023 15:24:23 -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=fm1; t=1680549863; x=1680636263; bh=FZEL2LyYcImzvZZjNh9aXtmaJ Tc1ElbK2NRnWr8bw3U=; b=ZYdmRs7c/0YOhmYXOcr8mkkm9FjISCWO6rvVjEU1A IGr5PbkMPR/taeyX1R4IDZFjDM74A7uVqLVA+oCSVa0AP8MZa0IPkSGY7UkqFS+r YTtid5UelOMUnfrBinuuw2juYmvaAUiyxaimxG21CBikAYz/rFK/0UpGQ/oNnHeK i8PLMmaUoN7Ouo4qcguilTSig2iKiZfLFZNNw07T6QzMyt/Dl4XXd33SQwty8uHK wRa6fQ7DEHcNfGuK0N5ql6DZJZiYa0TeK8XCNaX5eb2iAV7ys6gpLM8s44L+KlTA eJilG+pWbuHgfNTdmop3EJ/trxb9AezLQ1hZmnxzpqa/A== 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=fm2; t= 1680549863; x=1680636263; bh=FZEL2LyYcImzvZZjNh9aXtmaJTc1ElbK2NR nWr8bw3U=; b=AIbc2Sj+6utn6xkYnZH9wNK1fiUSWhvPQ1cQqYLXkHVafGzXxAz h0xthIVC8Wj6gTk3ql9uPOJbIiSAyETTYQBP1a228qZQ8wfLJtuewgjI12nvQl0a zqYuEzwcrWX/8FSkvOtkL9uO5FxWl1NU3e2LUkaMtNoZ4MPDo03NVNYDAoORPRXB 65COESgiFZir+I0m7HTbEVnZHIc4mevtVvPIvyFeSuggJML8OUDdL8dg3XNm/Nga HmWoTPwEDeuMZ+lTVapSL2WTdPKH1/e0g9MKMhy3DrQqwvoKfHnYOtjf46iaeN/K HUCbBhOMVkt8nFQpHXxRXJLvypeDuFI116w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeijedgudefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhggtgfgse htkeertdertdejnecuhfhrohhmpefmrhhishhtohhffhgvrhcujfgruhhgshgsrghkkhcu oegtohguvgeskhhhrghughhssggrkhhkrdhnrghmvgeqnecuggftrfgrthhtvghrnhepve fgleevieekgeejieekueevhfelieduvdelgeefkeejtdekvedttefgffevtedtnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheptghouggvsehkhh gruhhgshgsrghkkhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 3 Apr 2023 15:24:21 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , rybak.a.v@gmail.com, Christian Couder Subject: [PATCH v2 3/3] doc: interpret-trailers: fix examples Date: Mon, 3 Apr 2023 21:22:01 +0200 Message-Id: <14555cf87fa5fdc0ce14c7077ba212d16ad3bc76.1680548650.git.code@khaugsbakk.name> X-Mailer: git-send-email 2.40.0 In-Reply-To: References: <20230331181229.15255-1-code@khaugsbakk.name> 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 example where `msg.txt` already contains an s-o-b is wrong: $ cat msg.txt | git interpret-trailers --trailer sign Signed-off-by: Alice Signed-off-by: Alice A file which only consists of one trailer line is not interpreted as the original example must have expected. So change the examples to use the typical “subject/message” file. Cc: Christian Couder Signed-off-by: Kristoffer Haugsbakk --- Notes (series): This isn’t just a quirk of this series but also happens on `master`: $ 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 < > EOF Signed-off-by: Alice 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 c76efae76a..c6f5b92ecc 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)>"' -$ cat empty-msg.txt | git interpret-trailers +$ cat msg1.txt | git interpret-trailers --trailer sign +subject + +message Signed-off-by: Bob -$ cat msg.txt +$ cat msg2.txt +subject + +message + Signed-off-by: Alice -$ cat msg.txt | git interpret-trailers +$ cat msg2.txt | git interpret-trailers --trailer sign +subject + +message Signed-off-by: Alice ------------