From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70855C4167B for ; Sat, 5 Dec 2020 01:40:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AB4422E01 for ; Sat, 5 Dec 2020 01:40:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726291AbgLEBkV (ORCPT ); Fri, 4 Dec 2020 20:40:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbgLEBkV (ORCPT ); Fri, 4 Dec 2020 20:40:21 -0500 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 822C7C061A51 for ; Fri, 4 Dec 2020 17:39:40 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id x22so6865490wmc.5 for ; Fri, 04 Dec 2020 17:39:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IXVkuBMNSbPPBUL0VinOcopXvHrDJwf2Tipikc0D6oQ=; b=Za4fStEuaNXe8gEFgyJxFV1edA4mrsgTWeeEX7suW5jL7woDjVMY9gJC2mVDLUc55R J0QnwqKk44A/WTh2qMV4l8xIjDwnTidl9My/XQwYUIoDD63111dC5XT1k0YObgqHztgs 5sD4uPruCNmDHombUf3q4jyNI2WgJTH/wwhJnJ2+4acM5yF/IvOja8oYohhM49f2HmC/ NZpOjkS7uZU6kV0/ic8rQJTK41yr3J0AkQfg2UQ9g8vvuqvP99v97+tZ6tho+MJ18kVh UVRxwClK2Fjk7Q4U/85eF0XqEX75h08HFxC8e/iX/AhAECW3g1lSPyM49V5uhcjriLFz UWhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IXVkuBMNSbPPBUL0VinOcopXvHrDJwf2Tipikc0D6oQ=; b=cnYDWEL5DOrs72YnzRRszlQn+0phsbroZg3M0dGczHEmN5F3Yq2HFb48e8scskUAjq 6kleSTO4JVTrDLkolyLHxIyWARJy5o/UajSmgX0n9LGXPB9zsOpzbBLhLt22ijf/vyKZ MNQHKwK/lmzSJT1bXPzUb8Aw4+S2AhaB+DKie+k1k/tTEpV7eH9Hyy8mpdefADVLqImf iaiQfCA4Ezi4tFNs1jnXW7JkeUarhqjLko/cxQLjLqMDkXxeao452zaOcyTqacRa3Hxb tJ2NQ0TChMz7yPzSJ9A0GcbOuEbIenlLtflJXqh3hwAhkg3CAHHFZVwXw7vW9ilIUToc uQrQ== X-Gm-Message-State: AOAM532We0xtxnbc71YDduFFwvaRrHK56rWGmKvrSTuD0pNV93tI69cr A7QtcvJRlfEI9F2OogwzpZxIpc7iNI4I1A== X-Google-Smtp-Source: ABdhPJxG9NHDfapqksUTPV1icoXgF2ibbtcEzY9Em5Y5TgOsiXEwNn7b+ZZtCFE0cSqRCfIsI1+qdQ== X-Received: by 2002:a7b:cf30:: with SMTP id m16mr6794779wmg.145.1607132378935; Fri, 04 Dec 2020 17:39:38 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id a1sm5537821wrv.61.2020.12.04.17.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 17:39:38 -0800 (PST) From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= To: git@vger.kernel.org Cc: Junio C Hamano , Anders Waldenborg , christian.couder@gmail.com, peff@peff.net, jonathantanmy@google.com, =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Subject: [PATCH 2/5] pretty format %(trailers): avoid needless repetition Date: Sat, 5 Dec 2020 02:39:15 +0100 Message-Id: <20201205013918.18981-3-avarab@gmail.com> X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8 In-Reply-To: <20201025212652.3003036-1-anders@0x63.nu> References: <20201025212652.3003036-1-anders@0x63.nu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change the documentation for the various %(trailers) options so it isn't repeating part of the documentation for "only" about how boolean values are handled. Instead let's split the description of that into general documentation at the top. It then suffices to refer to it by listing the options as "opt[=bool]". I'm also changing it to "[=bool]" from "[=val]". It took me a couple of readings to realize that while to realize that these options were referring back to the "only" option's treatment of boolean values. Let's try to make this more explicit. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/pretty-formats.txt | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt index 54f793d424f..8e066594624 100644 --- a/Documentation/pretty-formats.txt +++ b/Documentation/pretty-formats.txt @@ -252,7 +252,14 @@ endif::git-rev-list[] interpreted by linkgit:git-interpret-trailers[1]. The `trailers` string may be followed by a colon - and zero or more comma-separated options: + and zero or more comma-separated options. ++ +The boolean options accept an optional value. The values `true`, +`false`, `on`, `off` etc. are all accepted. See the "boolean" +sub-section in "EXAMPLES" in linkgit:git-config[1]. If a boolean +option is given with no value it's enabled. If any option is provided +multiple times the last occurance wins. ++ ** 'key=': only show trailers with specified key. Matching is done case-insensitively and trailing colon is optional. If option is given multiple times trailer lines matching any of the keys are @@ -264,27 +271,21 @@ endif::git-rev-list[] desired it can be disabled with `only=false`. E.g., `%(trailers:key=Reviewed-by)` shows trailer lines with key `Reviewed-by`. -** 'only[=val]': select whether non-trailer lines from the trailer - block should be included. The `only` keyword may optionally be - followed by an equal sign and one of `true`, `on`, `yes` to omit or - `false`, `off`, `no` to show the non-trailer lines. If option is - given without value it is enabled. If given multiple times the last - value is used. +** 'only[=bool]': select whether non-trailer lines from the trailer + block should be included. ** 'separator=': specify a separator inserted between trailer lines. When this option is not given each trailer line is terminated with a line feed character. The string SEP may contain the literal formatting codes described above. To use comma as separator one must use `%x2C` as it would otherwise be parsed as - next option. If separator option is given multiple times only the - last one is used. E.g., `%(trailers:key=Ticket,separator=%x2C )` + next option. E.g., `%(trailers:key=Ticket,separator=%x2C )` shows all trailer lines whose key is "Ticket" separated by a comma and a space. -** 'unfold[=val]': make it behave as if interpret-trailer's `--unfold` - option was given. In same way as to for `only` it can be followed - by an equal sign and explicit value. E.g., +** 'unfold[=bool]': make it behave as if interpret-trailer's `--unfold` + option was given. E.g., `%(trailers:only,unfold=true)` unfolds and shows all trailer lines. -** 'valueonly[=val]': skip over the key part of the trailer line and only - show the value part. Also this optionally allows explicit value. +** 'valueonly[=bool]': skip over the key part of the trailer line and only + show the value part. NOTE: Some placeholders may depend on other options given to the revision traversal engine. For example, the `%g*` reflog options will -- 2.29.2.222.g5d2a92d10f8