From patchwork Wed Sep 28 08:38:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12991814 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 6C545C6FA82 for ; Wed, 28 Sep 2022 08:39:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233313AbiI1Ij4 (ORCPT ); Wed, 28 Sep 2022 04:39:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232693AbiI1Ijl (ORCPT ); Wed, 28 Sep 2022 04:39:41 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94F5F11148 for ; Wed, 28 Sep 2022 01:39:38 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id u16-20020a05600c211000b003b5152ebf09so707933wml.5 for ; Wed, 28 Sep 2022 01:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=qSCPsaHOAA1ikvoT+hkefK/2NQYBEkLgLHRVfqy65v0=; b=XQEMfZ/P2wckKgh3cBOual6/5OZlDRN9UEEoL7dvhmKt3auW/iIeyPd5z7Z6MRO6NR 9YQAL1aUppbT9STVTTW3HudYIAEjWv/zx0w7MEXGWc5eDMyt6g6P9wy2iHlQ2tKc/Rmm V/e4es+skpd89wlJQxW0/uFkACLqjVkWGHhCVg8i5dTpJMHtsA55NjVNEir8UT2mFS/C QgOPOkLKYDBtAuh2S4k0X0Huxix3ZiA+HtXFqAobruj6xXBk+Sw2YJjeXu/i7o00Auh5 yIpvzPF1AdVLGHkfh7pC6NcYLSXLH0HLb84F6RlBkl+P7aRcwUi3lItn4M1fd4Y5i29n DljA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=qSCPsaHOAA1ikvoT+hkefK/2NQYBEkLgLHRVfqy65v0=; b=X7JzfYWaarzqxVsIK8BGyPo7mvduYiLyrqoFWhMOr2bj0gsFdisdm/E8zIgkpCZt0f RJa0Agdp7QNupYCQfDHI6bVL2uGJP1Lq+zyLgIW1K5qulxW3A5eiS3AOVUpHjDQWzOhw 9F1I6i0oKHq1kybaY3shqyy2EpKSsLz+PfAYbdzZmtIvoePx/ZsYZWG0248ql4pVzbgF 4ZlsizO1MTkbMnCYeiTArcG9Y98zzq3WEw3xEd3vHQdynn/Q9Bsge99RD9/zEn2eiMAq Bhv04CVrq+CR0Mw5XgauvptaGahCGUqRR9niHdC2MeNj9kGB2MAlffTIclrmMSm1lJC8 YsQw== X-Gm-Message-State: ACrzQf1tO/kRDnFNIWvigtr9e5SCjluajYAx3Y6IF6Oqm9XIzGqmcdzR 3fRDMZ5pbCH+bbdtY7wKUb39S5pl7Em6sg== X-Google-Smtp-Source: AMsMyM5cOd11l+OvvgUm/98F1hZjP8KDB1t4K7wdycEHFSPgtWHA4OShifqx/2Bh+ARzVX0tYzmLDQ== X-Received: by 2002:a1c:440b:0:b0:3b3:330d:88d8 with SMTP id r11-20020a1c440b000000b003b3330d88d8mr6007081wma.31.1664354376694; Wed, 28 Sep 2022 01:39:36 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id 26-20020a05600c229a00b003b31fc77407sm1075026wmf.30.2022.09.28.01.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 01:39:36 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Victoria Dye , Taylor Blau , Emily Shaffer , Jonathan Nieder , John Cai , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v2 01/35] CodingGuidelines: update and clarify command-line conventions Date: Wed, 28 Sep 2022 10:38:56 +0200 Message-Id: X-Mailer: git-send-email 2.38.0.rc1.925.gb61c5ccd7da In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Edit the section which explains how to create a good SYNOPSIS section for clarity and accuracy, it was mostly introduced in c455bd8950e (CodingGuidelines: Add a section on writing documentation, 2010-11-04): * Change "extra" example to "file", which now naturally follows from previous "..." example (one or more) to "[...]" (zero or more). * Explain how we prefer spacing around "[]()" tokens and "|" alternatives, this is not a new policy, but just codifies what's already the pattern in the most wide use in the documentation. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/CodingGuidelines | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index 9fca21cc5f9..3d3bdeba9e4 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -650,8 +650,8 @@ Writing Documentation: (One or more of .) Optional parts are enclosed in square brackets: - [] - (Zero or one .) + [...] + (Zero or more of .) --exec-path[=] (Option with an optional argument. Note that the "=" is inside the @@ -665,6 +665,16 @@ Writing Documentation: [-q | --quiet] [--utf8 | --no-utf8] + Use spacing around "|" token(s), but not immediately after opening or + before closing a [] or () pair: + Do: [-q | --quiet] + Don't: [-q|--quiet] + + Don't use spacing around "|" tokens when they're used to seperate the + alternate arguments of an option: + Do: --track[=(direct|inherit)] + Don't: --track[=(direct | inherit)] + Parentheses are used for grouping: [( | )...] (Any number of either or . Parens are needed to make From patchwork Wed Sep 28 08:38:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12991815 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 93366C04A95 for ; Wed, 28 Sep 2022 08:40:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229951AbiI1IkA (ORCPT ); Wed, 28 Sep 2022 04:40:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232900AbiI1Ijl (ORCPT ); Wed, 28 Sep 2022 04:39:41 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA30113F09 for ; Wed, 28 Sep 2022 01:39:39 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id h7so6226139wru.10 for ; Wed, 28 Sep 2022 01:39:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=tosyrrb83lJV15u62cQrYf+ELhCA98hJlUsUjfzbf6Y=; b=hn489AoHYDGxtB9pC14jwNiA2D/uazHdm3QDBh05BctMDpqCSZ0Wo70mN0J610o9yq cRoJmO5vQpl4xIebUGpUzU8TV0NyDrEN3KeV+mDFYn96LqMpI4F/sg/5kt7VUnosHaFu 4HgjffVIphD3nY8/Iv1qGKH2DOhysF0z97/Y0cRvdXKKQ0in3IwEShydubZeIHkjNW7m cFCfC74Pr5jWYJZXa2RDv9zlFFueUBZn8GkUiqblFMBryr10OOL47nfkaeTZajCj5mCA yhh31hxgRqFRtjPcCeDV7iPfwDI71+jS/+di8C6gXXzFaHUIqWdPU3hpB7DEn2tc5M/4 rcIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=tosyrrb83lJV15u62cQrYf+ELhCA98hJlUsUjfzbf6Y=; b=xp4IMmmfhlMVKgwi/Gx39ILTgfkhyfGh8U1LBEoU/0pGbr2gXAd/jpO+BZDYdrhzZi N+ffruf0lzJ+ZQyuw09cIRF+CD2zfVupyATX4cOyJM52qfsF1Cwdl8Uqj6M46iMuTqMc o8z4aFKbnEIRz8neUHk9foWiD/XoSCpjKRJvbMc+viBHfZX4THBwePEL5CNnJC0uWFDa +QBaJoJOdL8otlgYAZE42yTmmOqdfhF9fVrcLgcpU+ocYvqlgBapcOf+raFWtTtj6Dn5 zx+FVoADX9UpGkXKRzy68p3eta4BY+nFncD7Y5/AmKL80U9lpYku+HurhML6I30HlBq5 XeaQ== X-Gm-Message-State: ACrzQf1Euv2N8VjptoT12GT4xswegR/Vm05nHU0K0VPx3tswQM6CsZGu EGBNIjuuAKAX0dMMzjkGbqG+g8tcyEANSw== X-Google-Smtp-Source: AMsMyM4hChYkQACzpXmbcsUNkCNfZfCBGP9TdIkpkVHVyorwMNdBvaYqe2fTOUE6MtlLyzcy54CPGA== X-Received: by 2002:a5d:64c2:0:b0:228:cb3e:1ce with SMTP id f2-20020a5d64c2000000b00228cb3e01cemr19682492wri.392.1664354377920; Wed, 28 Sep 2022 01:39:37 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id 26-20020a05600c229a00b003b31fc77407sm1075026wmf.30.2022.09.28.01.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 01:39:37 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Victoria Dye , Taylor Blau , Emily Shaffer , Jonathan Nieder , John Cai , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v2 02/35] builtin/bundle.c: use \t, not fix indentation 2-SP indentation Date: Wed, 28 Sep 2022 10:38:57 +0200 Message-Id: X-Mailer: git-send-email 2.38.0.rc1.925.gb61c5ccd7da In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Fix indentation issues introduced with 73c3253d75e (bundle: framework for options before bundle file, 2019-11-10), and carried forward in some subsequent commits. Signed-off-by: Ævar Arnfjörð Bjarmason --- builtin/bundle.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/builtin/bundle.c b/builtin/bundle.c index e80efce3a42..5c78894afd5 100644 --- a/builtin/bundle.c +++ b/builtin/bundle.c @@ -12,31 +12,31 @@ */ static const char * const builtin_bundle_usage[] = { - N_("git bundle create [] "), - N_("git bundle verify [] "), - N_("git bundle list-heads [...]"), - N_("git bundle unbundle [...]"), - NULL + N_("git bundle create [] "), + N_("git bundle verify [] "), + N_("git bundle list-heads [...]"), + N_("git bundle unbundle [...]"), + NULL }; static const char * const builtin_bundle_create_usage[] = { - N_("git bundle create [] "), - NULL + N_("git bundle create [] "), + NULL }; static const char * const builtin_bundle_verify_usage[] = { - N_("git bundle verify [] "), - NULL + N_("git bundle verify [] "), + NULL }; static const char * const builtin_bundle_list_heads_usage[] = { - N_("git bundle list-heads [...]"), - NULL + N_("git bundle list-heads [...]"), + NULL }; static const char * const builtin_bundle_unbundle_usage[] = { - N_("git bundle unbundle [...]"), - NULL + N_("git bundle unbundle [...]"), + NULL }; static int parse_options_cmd_bundle(int argc, From patchwork Wed Sep 28 08:38:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12991817 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 8CDA3C32771 for ; Wed, 28 Sep 2022 08:40:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233391AbiI1IkI (ORCPT ); Wed, 28 Sep 2022 04:40:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233157AbiI1Ijm (ORCPT ); Wed, 28 Sep 2022 04:39:42 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE6771A3BE for ; Wed, 28 Sep 2022 01:39:40 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id z13-20020a7bc7cd000000b003b5054c6f9bso718372wmk.2 for ; Wed, 28 Sep 2022 01:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=JvL7xdFYloeXr1xWrqgq+LeuChoJvSoMuTTMWo+XfBw=; b=meEwc31E3HFwKEv9TiwVfyVcDH7hN6CksdZ4gTlr7UKGd7P9DauRmElShGJIv0IQX2 audSy0Y/yBniotWV1rvOKEJD+TVV3FeySh11TGuh6G2fRMNdpQzd280w7uLvkLSel8zY ZGTJrokz/aVJaX0s85H6FUoT08IZ4mbVAhn2Q2ZOMFEcJpZUo+2UcbxSCuyYva5kIaKh 4ozOVhxcRbMsnSjZFr3pcJDdvOoejOEZbDNpcE4ge0z02IGY4MbJQR8L+cQD2FRdcjqs F9ZnLmCXPlTK0ilHEaGiT2oeIQTanzzVsRAr3L4qcQn5+rbQosDCN7PTbIj5JeCct5Mn 6SGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=JvL7xdFYloeXr1xWrqgq+LeuChoJvSoMuTTMWo+XfBw=; b=1Yz0+AL0JizOq4Q7DhOIjpdi9TuU9SHFYPWYMqkpiv/Q+YQldw6nhw3HAE/Zf+k5S8 8Xej/TyfDYuQUwNL+xp5N4hxyMCdsV6owAtcRmHg62/iPzAx21LTkUwXqYqRZPIKlnA8 /Om/LP6l11m/t3zZqnvY5PJT6d2ywrlHMgiZqKTh2aV7Tf2LdMeBhN8oyJU4GXktsML0 mDQTCmX2JeVNdN74df01mZdyeR7sRRHUcMi5uf6szvp2oxlmwWaPjrNhA4f2/RaiiYuP kJrXfxJhyXo6pitzw/wgRNPOt/Ch3Iv+oBoeSBE4LE+FQJOtr5uKcOPpC6NRYcmWjAVS qxUw== X-Gm-Message-State: ACrzQf3VesH/aFP3wRptW8CJT3QkDdtFztjUEc/V04ZAFaMkW3lF3Erh UWLlbsEf7uFeri/7lKge/BND1olAeMzBSQ== X-Google-Smtp-Source: AMsMyM48HD68A5c5pVtxvv1gy3zwnz38ullcVAo+KfqL/VVlJtgz1lt4pdeOJJeGUa89JFTwnsZ1BA== X-Received: by 2002:a05:600c:a49:b0:3a6:673a:2a9b with SMTP id c9-20020a05600c0a4900b003a6673a2a9bmr5733367wmq.3.1664354379017; Wed, 28 Sep 2022 01:39:39 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id 26-20020a05600c229a00b003b31fc77407sm1075026wmf.30.2022.09.28.01.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 01:39:38 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Victoria Dye , Taylor Blau , Emily Shaffer , Jonathan Nieder , John Cai , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v2 03/35] bundle: define subcommand -h in terms of command -h Date: Wed, 28 Sep 2022 10:38:58 +0200 Message-Id: X-Mailer: git-send-email 2.38.0.rc1.925.gb61c5ccd7da In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Avoid repeating the "-h" output for the "git bundle" command, and instead define the usage of each subcommand with macros, so that the "-h" output for the command itself can re-use those definitions. See [1], [2] and [3] for prior art using the same pattern. 1. b25b727494f (builtin/multi-pack-index.c: define common usage with a macro, 2021-03-30) 2. 8757b35d443 (commit-graph: define common usage with a macro, 2021-08-23) 3. 1e91d3faf6c (reflog: move "usage" variables and use macros, 2022-03-17) Signed-off-by: Ævar Arnfjörð Bjarmason --- builtin/bundle.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/builtin/bundle.c b/builtin/bundle.c index 5c78894afd5..1b08700bf9e 100644 --- a/builtin/bundle.c +++ b/builtin/bundle.c @@ -11,31 +11,40 @@ * bundle supporting "fetch", "pull", and "ls-remote". */ -static const char * const builtin_bundle_usage[] = { - N_("git bundle create [] "), - N_("git bundle verify [] "), - N_("git bundle list-heads [...]"), - N_("git bundle unbundle [...]"), - NULL +#define BUILTIN_BUNDLE_CREATE_USAGE \ + N_("git bundle create [] ") +#define BUILTIN_BUNDLE_VERIFY_USAGE \ + N_("git bundle verify [] ") +#define BUILTIN_BUNDLE_LIST_HEADS_USAGE \ + N_("git bundle list-heads [...]") +#define BUILTIN_BUNDLE_UNBUNDLE_USAGE \ + N_("git bundle unbundle [...]") + +static char const * const builtin_bundle_usage[] = { + BUILTIN_BUNDLE_CREATE_USAGE, + BUILTIN_BUNDLE_VERIFY_USAGE, + BUILTIN_BUNDLE_LIST_HEADS_USAGE, + BUILTIN_BUNDLE_UNBUNDLE_USAGE, + NULL, }; static const char * const builtin_bundle_create_usage[] = { - N_("git bundle create [] "), + BUILTIN_BUNDLE_CREATE_USAGE, NULL }; static const char * const builtin_bundle_verify_usage[] = { - N_("git bundle verify [] "), + BUILTIN_BUNDLE_VERIFY_USAGE, NULL }; static const char * const builtin_bundle_list_heads_usage[] = { - N_("git bundle list-heads [...]"), + BUILTIN_BUNDLE_LIST_HEADS_USAGE, NULL }; static const char * const builtin_bundle_unbundle_usage[] = { - N_("git bundle unbundle [...]"), + BUILTIN_BUNDLE_UNBUNDLE_USAGE, NULL }; From patchwork Wed Sep 28 08:38:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12991818 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 0471EC04A95 for ; Wed, 28 Sep 2022 08:40:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233445AbiI1IkN (ORCPT ); Wed, 28 Sep 2022 04:40:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233227AbiI1Ijn (ORCPT ); Wed, 28 Sep 2022 04:39:43 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5888222A6 for ; Wed, 28 Sep 2022 01:39:41 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id bk15so10871263wrb.13 for ; Wed, 28 Sep 2022 01:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=KFPD0Zh+O2ETtHnUrvkGHpwYBSO22ale6ykO8UgJ0as=; b=mVQuhpNwVz1W8r7XWk8GhCVs5R+F4cbeRur42rw5lfs4L3ZEdik6j8wFAyNZzb68T9 v+RTrR06IbT2IWvQOX4AH7jH4n6ieXZznppqEP0hHZ2vzBGbwg+CEySgTWZoIURTCBIo /UhlqWi5CG9tVDAh7g4zX4cR0gfStVkq4jt/dh5vXq9533yRNNkO4osGtQnC5wsnLnlA WPrv+Lrx10YgkfB+yHar8+WQZwAU8to3FvbVHPafsiYEMB7kd7AocjdSM8JcZg7kdWa2 YWcdxSJlbessvRVNyjgd71anl5wPxWGnpLvAO6mkPZhzL4cqZjpCl0oT8REjhW+f70Ie nBYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=KFPD0Zh+O2ETtHnUrvkGHpwYBSO22ale6ykO8UgJ0as=; b=Wd33C5mgG/LuIN7130H393/rlHjQFUGtFoZh6oxc7PTMqxCM/1jnEKJywaVRP/s35f aW6iKvWt26ht2jFFx2I3b47roa9yuauXV/PD0CNYOzpfZKs9h4FdJBvwc4wHLG1T4kMI i7qiFFfCclI6mune2kO1QCKEK7zhre0bJXXbzOUKjqbbOMSDNfMe+g+VHkCm1IsUUmnB ySRk8woHNgilF6aPzpzM9k2Y+6EvC/R+B5UGfbSDjLSHqT098XVI4lMlbph3wdFz1Nw9 Eu13OY1pofMP0UrYLOW4cLqd9XAghYF0zUse7p2Y3ncbX0hJKdlnqjNyHgkAG93BxXu/ kLrg== X-Gm-Message-State: ACrzQf0d9mB+nsfhj1AmpHu0UYCusKj1UsAwxW7SyQuJK/NMb8uVLpRo N9m0lTskqehxxLmP+kZ3+c7oJrIF555yUg== X-Google-Smtp-Source: AMsMyM4ws/Ku+ajabHUiyC5zeppAUJ8R+RXxQRaBR2fIh5TCsg2EWU6zqQ2ql0P0XYA9Xt6RWWJMPw== X-Received: by 2002:adf:ee84:0:b0:22c:c87d:1a14 with SMTP id b4-20020adfee84000000b0022cc87d1a14mr1133862wro.639.1664354380002; Wed, 28 Sep 2022 01:39:40 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id 26-20020a05600c229a00b003b31fc77407sm1075026wmf.30.2022.09.28.01.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 01:39:39 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Victoria Dye , Taylor Blau , Emily Shaffer , Jonathan Nieder , John Cai , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v2 04/35] blame: use a more detailed usage_msg_optf() error on bad -L Date: Wed, 28 Sep 2022 10:38:59 +0200 Message-Id: X-Mailer: git-send-email 2.38.0.rc1.925.gb61c5ccd7da In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Improve the error message emitted when there's a bad -L argument, and do so using the parse-options.c flavor of "usage()", instead of using the non-parse-options.c usage() function. This was the last user of usage() in this file. Signed-off-by: Ævar Arnfjörð Bjarmason --- builtin/blame.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index a9fe8cf7a68..8ec59fa2096 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -1108,12 +1108,13 @@ int cmd_blame(int argc, const char **argv, const char *prefix) anchor = 1; range_set_init(&ranges, range_list.nr); for (range_i = 0; range_i < range_list.nr; ++range_i) { + const char *arg = range_list.items[range_i].string; long bottom, top; - if (parse_range_arg(range_list.items[range_i].string, - nth_line_cb, &sb, lno, anchor, + if (parse_range_arg(arg, nth_line_cb, &sb, lno, anchor, &bottom, &top, sb.path, the_repository->index)) - usage(blame_usage); + usage_msg_optf(_("failed to parse -L argument '%s'"), + blame_opt_usage, options, arg); if ((!lno && (top || bottom)) || lno < bottom) die(Q_("file %s has only %lu line", "file %s has only %lu lines", From patchwork Wed Sep 28 08:39:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12991820 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 D4D72C32771 for ; Wed, 28 Sep 2022 08:40:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233539AbiI1IkT (ORCPT ); Wed, 28 Sep 2022 04:40:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233244AbiI1Ijo (ORCPT ); Wed, 28 Sep 2022 04:39:44 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF320357E7 for ; Wed, 28 Sep 2022 01:39:42 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id s14so18712539wro.0 for ; Wed, 28 Sep 2022 01:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=xLS7v7SXfPfuZUmYkrmwz1+ClqqC/KR2o5Ozz4zIDvU=; b=qM+5bHLb9qJENZmlGiSMOfS8wBDe/g99cKhlSEVm2HttJCIsLaI7Ko4tUemWyi3AkD v5y1/51YXnR3D8KCOWHFLqCMUflFehdc1CkdwYEtqBnHRevgR7hqYmjBBNV9fped/umS bSyS2vZtNp2RyXpZHLFOa8omE7GoWFAvez50CNvYDTHS/E71v6qX5I9Bxzoiy6SSJfBB /HpfH7uE8vUbibdNaYKvPJhzxlNYP6cmtmGTZjxkAOKkEN94pXehS9tvTrynD/3l5C0c 0Nvn1zUl7WnDL2OBhpRSXdp0sAISAOMH76SbclNdHREwXy9SzVw1+Mgc8BM+DF0OM62w EP4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=xLS7v7SXfPfuZUmYkrmwz1+ClqqC/KR2o5Ozz4zIDvU=; b=jfHHg4/IZbBktdOCKqxWbs6BK3Adg6WNK/Faal5X4EmGisQdydHqs+qWmfW2R9bHiB uvLrf4WS0KbqBkftPmRgJ7Fbm73wTtfNY/f3cohgcAvrPSqOkS/7f9sx5JhDX+V0F8l3 r4gJK7YBxMw14otM+XuPQOGdhHgwiu/PkN0pfrH9ASqC/o2FKipyAv/WirULLaup7I+U kzvEXEmV9VL2PM6x48YI5Gvb4Yzdq6bYAkdRrfzDzYkQY78WLpn+jTSHJio5MTzCIJWm ap2meuaZ3GNq73xW4bAlpFn16xe41Vf3YD0FHwn3Mj/QP79EooxU8/0h2kgNMaxUpAMW FqdA== X-Gm-Message-State: ACrzQf2SdJ0FVv4H1V7ASwn4dLv/JknZmC/8Uoz9aN88dmFTURMzZU+y KpStyeQzHcyzvtmH3xbGmf00HAIhJn/lMg== X-Google-Smtp-Source: AMsMyM44KaqeMiOa3E15Y1iEcN8kN/1RFFm2SxkCaGsnM5BdrVQDeRdotPK+8i/DCbiZR4DnNU4Q7A== X-Received: by 2002:adf:f604:0:b0:228:6004:bb70 with SMTP id t4-20020adff604000000b002286004bb70mr19543452wrp.646.1664354381092; Wed, 28 Sep 2022 01:39:41 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id 26-20020a05600c229a00b003b31fc77407sm1075026wmf.30.2022.09.28.01.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 01:39:40 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Victoria Dye , Taylor Blau , Emily Shaffer , Jonathan Nieder , John Cai , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v2 05/35] doc SYNOPSIS: don't use ' for subcommands Date: Wed, 28 Sep 2022 10:39:00 +0200 Message-Id: X-Mailer: git-send-email 2.38.0.rc1.925.gb61c5ccd7da In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Almost all of our documentation doesn't use "'" syntax for subcommands, but these did, let's make them consistent with the rest. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/git-reflog.txt | 2 +- Documentation/git-rerere.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/git-reflog.txt b/Documentation/git-reflog.txt index db9d46edfa9..0537d4645be 100644 --- a/Documentation/git-reflog.txt +++ b/Documentation/git-reflog.txt @@ -17,7 +17,7 @@ The command takes various subcommands, and different options depending on the subcommand: [verse] -'git reflog' ['show'] [] [] +'git reflog' [show] [] [] 'git reflog expire' [--expire=