Skip to content

Commit 97fe725

Browse files
avargitster
authored andcommitted
cat-file docs: fix SYNOPSIS and "-h" output
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 <type> <object>", but the SYNOPSIS section wasn't showing that as the first form! That part of the documentation made sense in d83a42f (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 4631cfc (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fa476be commit 97fe725

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

Documentation/git-cat-file.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ git-cat-file - Provide content or type and size information for repository objec
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git cat-file' (-t [--allow-unknown-type]| -s [--allow-unknown-type]| -e | -p | <type> | --textconv | --filters ) [--path=<path>] <object>
13-
'git cat-file' (--batch[=<format>] | --batch-check[=<format>]) [ --textconv | --filters ] [--follow-symlinks]
12+
'git cat-file' <type> <object>
13+
'git cat-file' (-e | -p) <object>
14+
'git cat-file' ( -t | -s ) [--allow-unknown-type] <object>
15+
'git cat-file' (--batch | --batch-check) [--batch-all-objects]
16+
[--buffer] [--follow-symlinks] [--unordered]
17+
[--textconv | --filters]
18+
'git cat-file' (--textconv | --filters )
19+
[<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]
1420

1521
DESCRIPTION
1622
-----------

builtin/cat-file.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,14 @@ static int batch_objects(struct batch_options *opt)
619619
}
620620

621621
static const char * const cat_file_usage[] = {
622-
N_("git cat-file (-t [--allow-unknown-type] | -s [--allow-unknown-type] | -e | -p | <type> | --textconv | --filters) [--path=<path>] <object>"),
623-
N_("git cat-file (--batch[=<format>] | --batch-check[=<format>]) [--follow-symlinks] [--textconv | --filters]"),
622+
N_("git cat-file <type> <object>"),
623+
N_("git cat-file (-e | -p) <object>"),
624+
N_("git cat-file ( -t | -s ) [--allow-unknown-type] <object>"),
625+
N_("git cat-file (--batch | --batch-check) [--batch-all-objects]\n"
626+
" [--buffer] [--follow-symlinks] [--unordered]\n"
627+
" [--textconv | --filters]"),
628+
N_("git cat-file (--textconv | --filters )\n"
629+
" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"),
624630
NULL
625631
};
626632

0 commit comments

Comments
 (0)