]> git.ipfire.org Git - thirdparty/git.git/commitdiff
cat-file: don't whitespace-pad "(...)" in SYNOPSIS and usage output
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 10 Jan 2022 22:08:45 +0000 (23:08 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Jan 2022 18:12:20 +0000 (10:12 -0800)
Fix up whitespace issues around "(... | ...)" in the SYNOPSIS and
usage. These were introduced in ab/cat-file series. See
e145efa6059 (Merge branch 'ab/cat-file' into next, 2022-01-05). In
particular 57d6a1cf965a40417876 and 97fe7250753 in that series.

We'll now correctly emit this usage output:

    $ git cat-file -h
    usage: git cat-file <type> <object>
       or: git cat-file (-e | -p) <object>
       or: git cat-file (-t | -s) [--allow-unknown-type] <object>
    [...]

Before this the last line of that would be inconsistent with the
preceding "(-e | -p)":

   or: git cat-file ( -t | -s ) [--allow-unknown-type] <object>

Reported-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-cat-file.txt
builtin/cat-file.c

index 73ebbc70ee245ae9d2c7417afa022cd519f1a70b..bef76f4dd060dd7fdd4efee44f53b34a3c546c13 100644 (file)
@@ -11,11 +11,11 @@ SYNOPSIS
 [verse]
 'git cat-file' <type> <object>
 'git cat-file' (-e | -p) <object>
-'git cat-file' ( -t | -s ) [--allow-unknown-type] <object>
+'git cat-file' (-t | -s) [--allow-unknown-type] <object>
 'git cat-file' (--batch | --batch-check) [--batch-all-objects]
             [--buffer] [--follow-symlinks] [--unordered]
             [--textconv | --filters]
-'git cat-file' (--textconv | --filters )
+'git cat-file' (--textconv | --filters)
             [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]
 
 DESCRIPTION
index ad9b3eef4f4c278b6f4a497fbe4dc3af8a09effc..e36492235bab5b7d0e8365f913aeccaebf4fc18c 100644 (file)
@@ -653,11 +653,11 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
        const char * const usage[] = {
                N_("git cat-file <type> <object>"),
                N_("git cat-file (-e | -p) <object>"),
-               N_("git cat-file ( -t | -s ) [--allow-unknown-type] <object>"),
+               N_("git cat-file (-t | -s) [--allow-unknown-type] <object>"),
                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"
+               N_("git cat-file (--textconv | --filters)\n"
                   "             [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"),
                NULL
        };
@@ -699,7 +699,7 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
                OPT_CMDMODE(0, "filters", &opt,
                            N_("run filters on object's content"), 'w'),
                OPT_STRING(0, "path", &force_path, N_("blob|tree"),
-                          N_("use a <path> for (--textconv | --filters ); Not with 'batch'")),
+                          N_("use a <path> for (--textconv | --filters); Not with 'batch'")),
                OPT_END()
        };