{"thread":{"id":"12231","subject":"[PATCH] Teach git-grep --name-only as synonym for -l","startedAt":"2008-02-21T04:23:39Z","lastAt":"2008-02-21T04:23:39Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"69449","messageId":"20080221042339.GA3195@spearce.org","threadId":"12231","inReplyTo":null,"subject":"[PATCH] Teach git-grep --name-only as synonym for -l","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-02-21T04:23:39Z","receivedAt":"2008-02-21T04:23:39Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"I expected git grep --name-only to give me only the file names,\nmuch as git diff --name-only only generates filenames.  Alas the\noption is -l, which matches common external greps but doesn't match\nother parts of the git UI.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n builtin-grep.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-grep.c b/builtin-grep.c\nindex 9180b39..f4f4ecb 100644\n--- a/builtin-grep.c\n+++ b/builtin-grep.c\n@@ -578,6 +578,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\t\tcontinue;\n \t\t}\n \t\tif (!strcmp(\"-l\", arg) ||\n+\t\t    !strcmp(\"--name-only\", arg) ||\n \t\t    !strcmp(\"--files-with-matches\", arg)) {\n \t\t\topt.name_only = 1;\n \t\t\tcontinue;\n-- \n1.5.4.2.232.g08e5\n"}]}