{"thread":{"id":"14549","subject":"[PATCH] fix usage string for git grep","startedAt":"2008-07-20T19:13:08Z","lastAt":"2008-07-20T19:13:08Z","messageCount":1,"participants":["Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"84054","messageId":"20080720141308.BIU48280@m4500-01.uchicago.edu","threadId":"14549","inReplyTo":null,"subject":"[PATCH] fix usage string for git grep","fromName":"Jonathan Nieder","fromEmail":"jrnieder@uchicago.edu","sentAt":"2008-07-20T19:13:08Z","receivedAt":"2008-07-20T19:13:08Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Without this patch, git-grep gives confusing usage information:\n\n\t$ git grep --confused\n\tusage: git grep <option>* <rev>* [-e] <pattern> [<path>...]\n\t$ git grep HEAD pattern\n\tfatal: ambiguous argument 'pattern': unknown revision or path no\n\tt in the working tree.\n\tUse '--' to separate paths from revisions\n\nSo put <pattern> before the <rev>s, in accordance with actual correct\nusage.  While we're changing the usage string, we might as well include\nthe \"--\" separating revisions and paths, too.\n\nSigned-off-by: Jonathan Nieder <jrnieder@uchicago.edu>\n---\n\tThanks!\n\n builtin-grep.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-grep.c b/builtin-grep.c\nindex 7bf6a71..631129d 100644\n--- a/builtin-grep.c\n+++ b/builtin-grep.c\n@@ -498,7 +498,7 @@ static int grep_object(struct grep_opt *opt, const char **paths,\n }\n \n static const char builtin_grep_usage[] =\n-\"git grep <option>* <rev>* [-e] <pattern> [<path>...]\";\n+\"git grep <option>* [-e] <pattern> <rev>* [[--] <path>...]\";\n \n static const char emsg_invalid_context_len[] =\n \"%s: invalid context length argument\";\n-- \n1.5.6.4.441.g4b4e9\n"}]}