{"thread":{"id":"38059","subject":"git file listing is inconsistent","startedAt":"2014-11-26T21:10:33Z","lastAt":"2014-11-26T22:01:51Z","messageCount":5,"participants":["Woody Gilk","Junio C Hamano","Jonathan Nieder","Scott Schmit"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"252603","messageId":"CAGOJM6+DTSn2qa-KTWceqyraaugX_YVZhirkdc+t+cDfFB4OyQ@mail.gmail.com","threadId":"38059","inReplyTo":null,"subject":"git file listing is inconsistent","fromName":"Woody Gilk","fromEmail":"woody.gilk@gmail.com","sentAt":"2014-11-26T21:10:33Z","receivedAt":"2014-11-26T21:10:33Z","isPatch":false,"sender":{"key":"woody.gilk@gmail.com","avatar":null},"body":"git diff --name-only\ngit grep --files-with-matches\n\nI think --files-with-matches should be deprecated and replaced with\n--name-only for consistency.\n\nThanks,\n--\nWoody Gilk\nhttp://about.me/shadowhand\n"},{"id":"252608","messageId":"xmqqd289prb2.fsf@gitster.dls.corp.google.com","threadId":"38059","inReplyTo":"CAGOJM6+DTSn2qa-KTWceqyraaugX_YVZhirkdc+t+cDfFB4OyQ@mail.gmail.com","subject":"Re: git file listing is inconsistent","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-26T21:47:45Z","receivedAt":"2014-11-26T21:47:45Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Woody Gilk <woody.gilk@gmail.com> writes:\n\n> git diff --name-only\n> git grep --files-with-matches\n>\n> I think --files-with-matches should be deprecated and replaced with\n> --name-only for consistency.\n\nThat longer name comes from \"GNU grep\" consistency.\n\nWhy anybody does not use a shorter and sweeter \"grep -l\" is beyond\nme, though ;-)\n"},{"id":"252610","messageId":"20141126215520.GS6527@google.com","threadId":"38059","inReplyTo":"CAGOJM6+DTSn2qa-KTWceqyraaugX_YVZhirkdc+t+cDfFB4OyQ@mail.gmail.com","subject":"Re: git file listing is inconsistent","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-11-26T21:55:20Z","receivedAt":"2014-11-26T21:55:20Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Woody,\n\nWoody Gilk wrote:\n\n> git diff --name-only\n> git grep --files-with-matches\n>\n> I think --files-with-matches should be deprecated and replaced with\n> --name-only for consistency.\n\nSee the (non-git) diff(1) and grep(1) manpages.\n\nIt might make sense for 'git grep' to learn --name-only too as a\nsynonym to help muscle memory, though.\n\n*looks*\n\nActually, 'git grep -h' tells me that git grep --name-only is already\naccepted as a synonym for --files-with-matches, ever since\n\n $ git log -Sname-only -- builtin-grep.c\n[...]\n commit 2cd5dfd240ecb63c77bcb2532664984e3b69ae47\n Author: Shawn O. Pearce <spearce@spearce.org>\n Date:   Wed Feb 20 23:28:07 2008 -0500\n\n     Teach git-grep --name-only as synonym for -l\n\n     I expected git grep --name-only to give me only the file names,\n     much as git diff --name-only only generates filenames.  Alas the\n     option is -l, which matches common external greps but doesn't match\n     other parts of the git UI.\n\n     Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n     Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\n(v1.5.5-rc0~171).  Have you tried it?\n\nWould something like the following patch help?\n\n-- >8 --\nSubject: grep doc: add reminder about --name-only option\n\nSince v1.5.5-rc0~171 (2008-02-20), \"git grep\" accepts --name-only\nas a synonym for the GNU-style --files-with-matches, but because the\nsynonym is not mentioned in the manpage synopsis it is hard to find.\n\nReported-by: Woody Gilk <woody.gilk@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Documentation/git-grep.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt\nindex 31811f1..8060efe 100644\n--- a/Documentation/git-grep.txt\n+++ b/Documentation/git-grep.txt\n@@ -14,7 +14,7 @@ SYNOPSIS\n \t   [-E | --extended-regexp] [-G | --basic-regexp]\n \t   [-P | --perl-regexp]\n \t   [-F | --fixed-strings] [-n | --line-number]\n-\t   [-l | --files-with-matches] [-L | --files-without-match]\n+\t   [-l | --files-with-matches | --name-only] [-L | --files-without-match]\n \t   [(-O | --open-files-in-pager) [<pager>]]\n \t   [-z | --null]\n \t   [-c | --count] [--all-match] [-q | --quiet]\n-- \n2.2.0.rc0.207.ga3a616c\n"},{"id":"252611","messageId":"20141126215949.GC3885@odin.ulthar.us","threadId":"38059","inReplyTo":"CAGOJM6+DTSn2qa-KTWceqyraaugX_YVZhirkdc+t+cDfFB4OyQ@mail.gmail.com","subject":"Re: git file listing is inconsistent","fromName":"Scott Schmit","fromEmail":"i.grok@comcast.net","sentAt":"2014-11-26T21:59:49Z","receivedAt":"2014-11-26T21:59:49Z","isPatch":false,"sender":{"key":"i.grok@comcast.net","avatar":null},"body":"On Wed, Nov 26, 2014 at 03:10:33PM -0600, Woody Gilk wrote:\n> git diff --name-only\n> git grep --files-with-matches\n> \n> I think --files-with-matches should be deprecated and replaced with\n> --name-only for consistency.\n\ngit grep supports both: --name-only for consistency with other git\ncommands, and --files-with-matches for consistency with grep(1).\n\nSo I don't think anything needs to change.  All we need to do is to\nteach grep(1) the --name-only option, and the cycle will be complete.\n[I can never remember grep's version of the option...] :-D\n\n-- \nScott Schmit\n"},{"id":"252612","messageId":"CAGOJM6KokBxxaWn=j03CBEp0B5yjWWyMxS=H6KhXEW0r-OPjLw@mail.gmail.com","threadId":"38059","inReplyTo":"20141126215520.GS6527@google.com","subject":"Re: git file listing is inconsistent","fromName":"Woody Gilk","fromEmail":"woody.gilk@gmail.com","sentAt":"2014-11-26T22:01:51Z","receivedAt":"2014-11-26T22:01:51Z","isPatch":false,"sender":{"key":"woody.gilk@gmail.com","avatar":null},"body":"Jonathan,\n\nOn Wed, Nov 26, 2014 at 3:55 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Actually, 'git grep -h' tells me that git grep --name-only is already\n> accepted as a synonym for --files-with-matches, ever since\n\nYou are absolutely right, it was a typo (and then not RTFM the\nresulting help) on my part that caused the confusion.\n\nNothing needs to change here. :)\n--\nWoody Gilk\nhttp://about.me/shadowhand\n"}]}