{"thread":{"id":"18885","subject":"\"git cat-file <sha1>\" shows usage but should not?","startedAt":"2009-04-15T16:50:47Z","lastAt":"2009-04-15T17:36:41Z","messageCount":8,"participants":["Sebastian Pipping","Jeff King","Junio C Hamano","Julian Phillips"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"111375","messageId":"49E61067.6060802@hartwork.org","threadId":"18885","inReplyTo":null,"subject":"\"git cat-file <sha1>\" shows usage but should not?","fromName":"Sebastian Pipping","fromEmail":"webmaster@hartwork.org","sentAt":"2009-04-15T16:50:47Z","receivedAt":"2009-04-15T16:50:47Z","isPatch":false,"sender":{"key":"webmaster@hartwork.org","avatar":null},"body":"Here is what I did:\n\n\n$ git cat-file -t b8c11fbbffbe171c4960058fa2d96f708e57a80c\ncommit\n\n$ git cat-file b8c11fbbffbe171c4960058fa2d96f708e57a80c\nusage: git cat-file [-t|-s|-e|-p|<type>] <sha1>\n   or: git cat-file [--batch|--batch-check] < <list_of_sha1s>\n[..]\n\n$ git --version\ngit version 1.6.3.rc0.1.gf800.dirty\n\n\n\nSebastian\n"},{"id":"111376","messageId":"20090415165420.GB24528@coredump.intra.peff.net","threadId":"18885","inReplyTo":"49E61067.6060802@hartwork.org","subject":"Re: \"git cat-file <sha1>\" shows usage but should not?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-15T16:54:20Z","receivedAt":"2009-04-15T16:54:20Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Apr 15, 2009 at 06:50:47PM +0200, Sebastian Pipping wrote:\n\n> Here is what I did:\n> \n> $ git cat-file -t b8c11fbbffbe171c4960058fa2d96f708e57a80c\n> commit\n> \n> $ git cat-file b8c11fbbffbe171c4960058fa2d96f708e57a80c\n> usage: git cat-file [-t|-s|-e|-p|<type>] <sha1>\n>    or: git cat-file [--batch|--batch-check] < <list_of_sha1s>\n> [..]\n\nThat usage message is misleading. You need to use one of -t, -s, -e, -p,\nor <type>. So it should perhaps just be:\n\n  git cat-file -t|-s|-e|-p|<type> <sha1>\n\nthough that looks terribly ugly. Suggestions welcome.\n\n-Peff\n\nP.S. Depending on what you're trying to accomplish, \"git show <sha1>\"\n     may be a better choice.\n"},{"id":"111377","messageId":"49E611A5.8090602@hartwork.org","threadId":"18885","inReplyTo":"20090415165420.GB24528@coredump.intra.peff.net","subject":"Re: \"git cat-file <sha1>\" shows usage but should not?","fromName":"Sebastian Pipping","fromEmail":"webmaster@hartwork.org","sentAt":"2009-04-15T16:56:05Z","receivedAt":"2009-04-15T16:56:05Z","isPatch":false,"sender":{"key":"webmaster@hartwork.org","avatar":null},"body":"Jeff King wrote:\n> That usage message is misleading. You need to use one of -t, -s, -e, -p,\n> or <type>. So it should perhaps just be:\n> \n>   git cat-file -t|-s|-e|-p|<type> <sha1>\n> \n> though that looks terribly ugly. Suggestions welcome.\n\nThanks for making that clear.  How about round or curly brackets?\n\n\n\nSebastian\n"},{"id":"111378","messageId":"20090415170444.GA24717@coredump.intra.peff.net","threadId":"18885","inReplyTo":"49E611A5.8090602@hartwork.org","subject":"Re: \"git cat-file <sha1>\" shows usage but should not?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-15T17:04:44Z","receivedAt":"2009-04-15T17:04:44Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Apr 15, 2009 at 06:56:05PM +0200, Sebastian Pipping wrote:\n\n> Jeff King wrote:\n> > That usage message is misleading. You need to use one of -t, -s, -e, -p,\n> > or <type>. So it should perhaps just be:\n> > \n> >   git cat-file -t|-s|-e|-p|<type> <sha1>\n> > \n> > though that looks terribly ugly. Suggestions welcome.\n> \n> Thanks for making that clear.  How about round or curly brackets?\n\nI think curly makes the most sense for grouping, though I still think it\nis a bit ugly. Patch is below.\n\n-- >8 --\nSubject: [PATCH] fix cat-file usage message and documentation\n\ncat-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\ncurly braces to indicate \"required but grouped-OR\".\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---\nThe curly braces seem to render fine via asciidoc (presumably because\nthere is no entity with that name), but I'm not sure if that will work\nwith all asciidoc versions.\n\n Documentation/git-cat-file.txt |    2 +-\n builtin-cat-file.c             |    4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt\nindex b191276..0856568 100644\n--- a/Documentation/git-cat-file.txt\n+++ b/Documentation/git-cat-file.txt\n@@ -9,7 +9,7 @@ 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' {-t | -s | -e | -p | <type>} <object>\n 'git cat-file' [--batch | --batch-check] < <list-of-objects>\n \n DESCRIPTION\ndiff --git a/builtin-cat-file.c b/builtin-cat-file.c\nindex 8fad19d..4e6ad73 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.rc0.156.g19ef8\n"},{"id":"111379","messageId":"7vprfdvnrj.fsf@gitster.siamese.dyndns.org","threadId":"18885","inReplyTo":"20090415170444.GA24717@coredump.intra.peff.net","subject":"Re: \"git cat-file <sha1>\" shows usage but should not?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-15T17:18:40Z","receivedAt":"2009-04-15T17:18:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Wed, Apr 15, 2009 at 06:56:05PM +0200, Sebastian Pipping wrote:\n>\n>> Jeff King wrote:\n>> > That usage message is misleading. You need to use one of -t, -s, -e, -p,\n>> > or <type>. So it should perhaps just be:\n>> > \n>> >   git cat-file -t|-s|-e|-p|<type> <sha1>\n>> > \n>> > though that looks terribly ugly. Suggestions welcome.\n>> \n>> Thanks for making that clear.  How about round or curly brackets?\n>\n> I think curly makes the most sense for grouping, though I still think it\n> is a bit ugly. Patch is below.\n\nThanks.  Doesn't this remind us of $gmane/72243, by the way?\n"},{"id":"111384","messageId":"alpine.LNX.2.00.0904151827530.14321@reaper.quantumfyre.co.uk","threadId":"18885","inReplyTo":"20090415170444.GA24717@coredump.intra.peff.net","subject":"Re: \"git cat-file <sha1>\" shows usage but should not?","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2009-04-15T17:33:10Z","receivedAt":"2009-04-15T17:33:10Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Wed, 15 Apr 2009, Jeff King wrote:\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\nShouldn't that read:\n\n+\t\"git cat-file {--batch|--batch-check} < <list_of_objects>\",\n\nsince, like the previous line, you are required to supply one of the two \noptions?\n\n-- \nJulian\n\n  ---\nDPRINTK(\"FAILURE, CAPUT\\n\");\n         linux-2.6.6/drivers/net/tokenring/ibmtr.c\n"},{"id":"111385","messageId":"20090415173440.GA25480@coredump.intra.peff.net","threadId":"18885","inReplyTo":"7vprfdvnrj.fsf@gitster.siamese.dyndns.org","subject":"Re: \"git cat-file <sha1>\" shows usage but should not?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-15T17:34:40Z","receivedAt":"2009-04-15T17:34:40Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Apr 15, 2009 at 10:18:40AM -0700, Junio C Hamano wrote:\n\n> > I think curly makes the most sense for grouping, though I still think it\n> > is a bit ugly. Patch is below.\n> \n> Thanks.  Doesn't this remind us of $gmane/72243, by the way?\n\nAh, yes. I felt like we had dealt with this before, but I couldn't\nremember for what.\n\nThat message indicates that {} is preferred to (). Interestingly,\nthough, the stash usage and documentation still uses ().\n\n-Peff\n"},{"id":"111386","messageId":"20090415173640.GB25480@coredump.intra.peff.net","threadId":"18885","inReplyTo":"alpine.LNX.2.00.0904151827530.14321@reaper.quantumfyre.co.uk","subject":"Re: \"git cat-file <sha1>\" shows usage but should not?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-15T17:36:41Z","receivedAt":"2009-04-15T17:36:41Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Apr 15, 2009 at 06:33:10PM +0100, Julian Phillips wrote:\n\n> On Wed, 15 Apr 2009, Jeff King wrote:\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>\n> Shouldn't that read:\n>\n> +\t\"git cat-file {--batch|--batch-check} < <list_of_objects>\",\n>\n> since, like the previous line, you are required to supply one of the two  \n> options?\n\nOops, yes, it should.\n\n-Peff\n"}]}