From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 278381F9F4 for ; Fri, 12 Nov 2021 22:21:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234123AbhKLWXu (ORCPT ); Fri, 12 Nov 2021 17:23:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234085AbhKLWXr (ORCPT ); Fri, 12 Nov 2021 17:23:47 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ABABC061767 for ; Fri, 12 Nov 2021 14:20:56 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id z200so8957351wmc.1 for ; Fri, 12 Nov 2021 14:20:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eHcgkmmvHOezsCWyrvLz5vZQClyvX60Hdtcd0IFSWq8=; b=iaDk+2WoH2uspOnlNGaLrm0MgxYm1Yb7tyuWtwgiplZcekayXozroIUKWZ5QC/ZfoB 3Sb1EIblxGzfcRxCkF30EsjkLTcaV/kfaSRH4wSgGY6lf4i3dCE6bsrRabahST9BUTFp JOCLJG6GRfbiYaBkBiS6YZlNl7/ZF0E7JX1oep9y8YWd4vX6VGisJ3GjxamRaqjP5DOY Dx3LEBuVhL1asZDEZqWBiHMxpR2ljlfcr8PLIPZPFSX6xiv+VCpQ4uEm6xG23WTa1LgF mCw9CqrYFVGax/qXSPpfPVxAYVEgR9QeLPj+a9YLkBdBLZety/+01evSn51dpmffnu8C WXsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eHcgkmmvHOezsCWyrvLz5vZQClyvX60Hdtcd0IFSWq8=; b=k5t2VqShma8/oz2NqrrDWYQyC8qgwmpbLIVTS+3EGn9And9+ACI9F4cdsFXQyrRled LDIvgCnf5/AN21XIKIEPs7q5hyrgBr3w5e9JgflIRZWcNjRD7Wn8eBZpM92oVVbUpggK mfqxJMMxFB75m4H6PKRGXna2EFASynFFqZ+6CXFZ6933u0xX6DKSvIicS+q9yAuc2aaa m/il7KFHQLCGiMZGqfLZR1F+Z9phacTJufv/b6s5GV34+NBFuApdNV5W8yDUlLbw8JrM rJQDcpndeiPPnml0KDxFLHAnJsuFDLd9pTsxqxZAiSMoSL6a9ECSzMcW1jjrumc6/+oU FA/w== X-Gm-Message-State: AOAM533Pp1Ocv12oUU12dIBBDVsz9dIPv93Q/pSjgPAiIGmCpkKiF6Mh EWueXn82bW+Il3mF/Fa9jWiAG8eFmExTVQ== X-Google-Smtp-Source: ABdhPJzCDmck43vKzX/+wpRzWCVe6W9xWhdNzJpktn4vhDWMc2ZYIwFaAk7BC52QSNJMfyf5BMAC/g== X-Received: by 2002:a05:600c:1e26:: with SMTP id ay38mr21165569wmb.14.1636755654687; Fri, 12 Nov 2021 14:20:54 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id f7sm7896985wri.74.2021.11.12.14.20.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Nov 2021 14:20:54 -0800 (PST) From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , John Cai , Sergey Organov , =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Subject: [PATCH v2 04/10] cat-file docs: fix SYNOPSIS and "-h" output Date: Fri, 12 Nov 2021 23:20:02 +0100 Message-Id: X-Mailer: git-send-email 2.34.0.rc2.795.g926201d1cc8 In-Reply-To: References: 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 There were various inaccuracies in the previous SYNOPSIS output, e.g. "--path" is not something that can optionally go with any options except --textconv or --filters, as the output implied. The opening line of the DESCRIPTION section is also "In its first form[...]", which refers to "git cat-file ", but the SYNOPSIS section wasn't showing that as the first form! That part of the documentation made sense in d83a42f34a6 (Documentation: minor grammatical fixes in git-cat-file.txt, 2009-03-22) when it was introduced, but since then various options that were added have made that intro make no sense in the context it was in. Now the two will match again. The usage output here is not properly aligned on "master" currently, but will be with my in-flight 4631cfc20bd (parse-options: properly align continued usage output, 2021-09-21), so let's indent things correctly in the C code in anticipation of that. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/git-cat-file.txt | 10 ++++++++-- builtin/cat-file.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt index 27b27e2b300..73ebbc70ee2 100644 --- a/Documentation/git-cat-file.txt +++ b/Documentation/git-cat-file.txt @@ -9,8 +9,14 @@ git-cat-file - Provide content or type and size information for repository objec SYNOPSIS -------- [verse] -'git cat-file' (-t [--allow-unknown-type]| -s [--allow-unknown-type]| -e | -p | | --textconv | --filters ) [--path=] -'git cat-file' (--batch[=] | --batch-check[=]) [ --textconv | --filters ] [--follow-symlinks] +'git cat-file' +'git cat-file' (-e | -p) +'git cat-file' ( -t | -s ) [--allow-unknown-type] +'git cat-file' (--batch | --batch-check) [--batch-all-objects] + [--buffer] [--follow-symlinks] [--unordered] + [--textconv | --filters] +'git cat-file' (--textconv | --filters ) + [: | --path= ] DESCRIPTION ----------- diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 86fc03242b8..1df7f797cb6 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -619,8 +619,14 @@ static int batch_objects(struct batch_options *opt) } static const char * const cat_file_usage[] = { - N_("git cat-file (-t [--allow-unknown-type] | -s [--allow-unknown-type] | -e | -p | | --textconv | --filters) [--path=] "), - N_("git cat-file (--batch[=] | --batch-check[=]) [--follow-symlinks] [--textconv | --filters]"), + N_("git cat-file "), + N_("git cat-file (-e | -p) "), + N_("git cat-file ( -t | -s ) [--allow-unknown-type] "), + N_("git cat-file (--batch | --batch-check) [--batch-all-objects]\n" + " [--buffer] [--follow-symlinks] [--unordered]\n" + " [--textconv | --filters]"), + N_("git cat-file (--textconv | --filters )\n" + " [: | --path= ]"), NULL }; -- 2.34.0.rc2.795.g926201d1cc8