summaryrefslogtreecommitdiff
path: root/builtin-grep.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-02-21 04:28:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-02-21 04:36:20 (GMT)
commit2cd5dfd240ecb63c77bcb2532664984e3b69ae47 (patch)
tree5d6736622f383d4c2abadc22daa3df199bcc5824 /builtin-grep.c
parent14a5c7c19351a7db56803c9086b133fe131f55f6 (diff)
downloadgit-2cd5dfd240ecb63c77bcb2532664984e3b69ae47.zip
git-2cd5dfd240ecb63c77bcb2532664984e3b69ae47.tar.gz
git-2cd5dfd240ecb63c77bcb2532664984e3b69ae47.tar.bz2
Teach git-grep --name-only as synonym for -l
I expected git grep --name-only to give me only the file names, much as git diff --name-only only generates filenames. Alas the option is -l, which matches common external greps but doesn't match other parts of the git UI. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-grep.c')
-rw-r--r--builtin-grep.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin-grep.c b/builtin-grep.c
index 9180b39..f4f4ecb 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -578,6 +578,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
continue;
}
if (!strcmp("-l", arg) ||
+ !strcmp("--name-only", arg) ||
!strcmp("--files-with-matches", arg)) {
opt.name_only = 1;
continue;