From: Jeff King <peff@peff.net>
To: Sebastian Pipping <webmaster@hartwork.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: "git cat-file <sha1>" shows usage but should not?
Date: Wed, 15 Apr 2009 13:04:44 -0400 [thread overview]
Message-ID: <20090415170444.GA24717@coredump.intra.peff.net> (raw)
In-Reply-To: <49E611A5.8090602@hartwork.org>
On Wed, Apr 15, 2009 at 06:56:05PM +0200, Sebastian Pipping wrote:
> Jeff King wrote:
> > That usage message is misleading. You need to use one of -t, -s, -e, -p,
> > or <type>. So it should perhaps just be:
> >
> > git cat-file -t|-s|-e|-p|<type> <sha1>
> >
> > though that looks terribly ugly. Suggestions welcome.
>
> Thanks for making that clear. How about round or curly brackets?
I think curly makes the most sense for grouping, though I still think it
is a bit ugly. Patch is below.
-- >8 --
Subject: [PATCH] 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
curly braces to indicate "required but grouped-OR".
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.
---
The curly braces seem to render fine via asciidoc (presumably because
there is no entity with that name), but I'm not sure if that will work
with all asciidoc versions.
Documentation/git-cat-file.txt | 2 +-
builtin-cat-file.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt
index b191276..0856568 100644
--- a/Documentation/git-cat-file.txt
+++ b/Documentation/git-cat-file.txt
@@ -9,7 +9,7 @@ git-cat-file - Provide content or type and size information for repository objec
SYNOPSIS
--------
[verse]
-'git cat-file' [-t | -s | -e | -p | <type>] <object>
+'git cat-file' {-t | -s | -e | -p | <type>} <object>
'git cat-file' [--batch | --batch-check] < <list-of-objects>
DESCRIPTION
diff --git a/builtin-cat-file.c b/builtin-cat-file.c
index 8fad19d..4e6ad73 100644
--- a/builtin-cat-file.c
+++ b/builtin-cat-file.c
@@ -201,8 +201,8 @@ static int batch_objects(int print_contents)
}
static const char * const cat_file_usage[] = {
- "git cat-file [-t|-s|-e|-p|<type>] <sha1>",
- "git cat-file [--batch|--batch-check] < <list_of_sha1s>",
+ "git cat-file {-t|-s|-e|-p|<type>} <object>",
+ "git cat-file [--batch|--batch-check] < <list_of_objects>",
NULL
};
--
1.6.3.rc0.156.g19ef8
next prev parent reply other threads:[~2009-04-15 17:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-15 16:50 "git cat-file <sha1>" shows usage but should not? Sebastian Pipping
2009-04-15 16:54 ` Jeff King
2009-04-15 16:56 ` Sebastian Pipping
2009-04-15 17:04 ` Jeff King [this message]
2009-04-15 17:18 ` Junio C Hamano
2009-04-15 17:34 ` Jeff King
2009-04-15 17:33 ` Julian Phillips
2009-04-15 17:36 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090415170444.GA24717@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=webmaster@hartwork.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).