{"thread":{"id":"19495","subject":"[PATCH] fix cat-file usage message and documentation","startedAt":"2009-05-25T10:33:15Z","lastAt":"2009-05-25T10:33:15Z","messageCount":1,"participants":["Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"114650","messageId":"20090525103315.GA26263@coredump.intra.peff.net","threadId":"19495","inReplyTo":null,"subject":"[PATCH] fix cat-file usage message and documentation","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-05-25T10:33:15Z","receivedAt":"2009-05-25T10:33:15Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"cat-file with an object on the command line requires an\noption to tell it what to output (type, size, pretty-print,\netc). However, the square brackets in the usage imply that\nthose options are not required. This patch switches them to\nparentheses to indicate \"required but grouped-OR\" (curly\nbraces might also work, but this follows the convention used\nalready by \"git stash\").\n\nWhile we're at it, let's change the <sha1> specifier in the\nusage to <object>. That's what the documentation uses, and\nit does actually use the regular object lookup.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThis is a followup to:\n\n  http://thread.gmane.org/gmane.comp.version-control.git/116627\n\n Documentation/git-cat-file.txt |    4 ++--\n builtin-cat-file.c             |    4 ++--\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt\nindex b191276..58c8d65 100644\n--- a/Documentation/git-cat-file.txt\n+++ b/Documentation/git-cat-file.txt\n@@ -9,8 +9,8 @@ git-cat-file - Provide content or type and size information for repository objec\n SYNOPSIS\n --------\n [verse]\n-'git cat-file' [-t | -s | -e | -p | <type>] <object>\n-'git cat-file' [--batch | --batch-check] < <list-of-objects>\n+'git cat-file' (-t | -s | -e | -p | <type>) <object>\n+'git cat-file' (--batch | --batch-check) < <list-of-objects>\n \n DESCRIPTION\n -----------\ndiff --git a/builtin-cat-file.c b/builtin-cat-file.c\nindex 8fad19d..43ffe7f 100644\n--- a/builtin-cat-file.c\n+++ b/builtin-cat-file.c\n@@ -201,8 +201,8 @@ static int batch_objects(int print_contents)\n }\n \n static const char * const cat_file_usage[] = {\n-\t\"git cat-file [-t|-s|-e|-p|<type>] <sha1>\",\n-\t\"git cat-file [--batch|--batch-check] < <list_of_sha1s>\",\n+\t\"git cat-file (-t|-s|-e|-p|<type>) <object>\",\n+\t\"git cat-file (--batch|--batch-check) < <list_of_objects>\",\n \tNULL\n };\n \n-- \n1.6.3.1.250.g01b8b.dirty\n"}]}