Skip to content

Commit 0e5168f

Browse files
peffgitster
authored andcommitted
fix cat-file usage message and documentation
cat-file with an object on the command line requires an option to tell it what to output (type, size, pretty-print, etc). However, the square brackets in the usage imply that those options are not required. This patch switches them to parentheses to indicate "required but grouped-OR" (curly braces might also work, but this follows the convention used already by "git stash"). While we're at it, let's change the <sha1> specifier in the usage to <object>. That's what the documentation uses, and it does actually use the regular object lookup. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fa25075 commit 0e5168f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Documentation/git-cat-file.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ git-cat-file - Provide content or type and size information for repository objec
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git cat-file' [-t | -s | -e | -p | <type>] <object>
13-
'git cat-file' [--batch | --batch-check] < <list-of-objects>
12+
'git cat-file' (-t | -s | -e | -p | <type>) <object>
13+
'git cat-file' (--batch | --batch-check) < <list-of-objects>
1414

1515
DESCRIPTION
1616
-----------

builtin-cat-file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ static int batch_objects(int print_contents)
201201
}
202202

203203
static const char * const cat_file_usage[] = {
204-
"git cat-file [-t|-s|-e|-p|<type>] <sha1>",
205-
"git cat-file [--batch|--batch-check] < <list_of_sha1s>",
204+
"git cat-file (-t|-s|-e|-p|<type>) <object>",
205+
"git cat-file (--batch|--batch-check) < <list_of_objects>",
206206
NULL
207207
};
208208

0 commit comments

Comments
 (0)