Skip to content

Commit f6a5676

Browse files
committed
Merge branch 'sn/cat-file-doc-update' into maint-2.42
"git cat-file" documentation updates. * sn/cat-file-doc-update: doc/cat-file: make synopsis and description less confusing
2 parents f92cea1 + cebfaaa commit f6a5676

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

Documentation/git-cat-file.txt

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,32 @@ git-cat-file(1)
33

44
NAME
55
----
6-
git-cat-file - Provide content or type and size information for repository objects
7-
6+
git-cat-file - Provide contents or details of repository objects
87

98
SYNOPSIS
109
--------
1110
[verse]
1211
'git cat-file' <type> <object>
1312
'git cat-file' (-e | -p) <object>
1413
'git cat-file' (-t | -s) [--allow-unknown-type] <object>
14+
'git cat-file' (--textconv | --filters)
15+
[<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]
1516
'git cat-file' (--batch | --batch-check | --batch-command) [--batch-all-objects]
1617
[--buffer] [--follow-symlinks] [--unordered]
1718
[--textconv | --filters] [-Z]
18-
'git cat-file' (--textconv | --filters)
19-
[<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]
2019

2120
DESCRIPTION
2221
-----------
23-
In its first form, the command provides the content or the type of an object in
24-
the repository. The type is required unless `-t` or `-p` is used to find the
25-
object type, or `-s` is used to find the object size, or `--textconv` or
26-
`--filters` is used (which imply type "blob").
27-
28-
In the second form, a list of objects (separated by linefeeds) is provided on
29-
stdin, and the SHA-1, type, and size of each object is printed on stdout. The
30-
output format can be overridden using the optional `<format>` argument. If
31-
either `--textconv` or `--filters` was specified, the input is expected to
32-
list the object names followed by the path name, separated by a single
33-
whitespace, so that the appropriate drivers can be determined.
22+
Output the contents or other properties such as size, type or delta
23+
information of one or more objects.
24+
25+
This command can operate in two modes, depending on whether an option
26+
from the `--batch` family is specified.
27+
28+
In non-batch mode, the command provides information on an object
29+
named on the command line.
30+
31+
In batch mode, arguments are read from standard input.
3432

3533
OPTIONS
3634
-------
@@ -51,8 +49,8 @@ OPTIONS
5149

5250
-e::
5351
Exit with zero status if `<object>` exists and is a valid
54-
object. If `<object>` is of an invalid format exit with non-zero and
55-
emits an error on stderr.
52+
object. If `<object>` is of an invalid format, exit with non-zero
53+
status and emit an error on stderr.
5654

5755
-p::
5856
Pretty-print the contents of `<object>` based on its type.

builtin/cat-file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,11 +922,11 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
922922
N_("git cat-file <type> <object>"),
923923
N_("git cat-file (-e | -p) <object>"),
924924
N_("git cat-file (-t | -s) [--allow-unknown-type] <object>"),
925+
N_("git cat-file (--textconv | --filters)\n"
926+
" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"),
925927
N_("git cat-file (--batch | --batch-check | --batch-command) [--batch-all-objects]\n"
926928
" [--buffer] [--follow-symlinks] [--unordered]\n"
927929
" [--textconv | --filters] [-Z]"),
928-
N_("git cat-file (--textconv | --filters)\n"
929-
" [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"),
930930
NULL
931931
};
932932
const struct option options[] = {

0 commit comments

Comments
 (0)