summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 14a5c7c)
raw | patch | inline | side by side (parent: 14a5c7c)
author | Shawn O. Pearce <spearce@spearce.org> | |
Thu, 21 Feb 2008 04:28:07 +0000 (23:28 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 21 Feb 2008 04:36:20 +0000 (20:36 -0800) |
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>
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>
Documentation/git-grep.txt | patch | blob | history | |
builtin-grep.c | patch | blob | history |
index f3cb24f252e2091d4d2f346b61ce87088fa7b02e..71a73354f8cfa960f641d9563ee8af405b4f881f 100644 (file)
-n::
Prefix the line number to matching lines.
--l | --files-with-matches | -L | --files-without-match::
+-l | --files-with-matches | --name-only | -L | --files-without-match::
Instead of showing every matched line, show only the
names of files that contain (or do not contain) matches.
+ For better compatability with git-diff, --name-only is a
+ synonym for --files-with-matches.
-c | --count::
Instead of showing every matched line, show the number of
diff --git a/builtin-grep.c b/builtin-grep.c
index 9180b39e3f22e5d3805649c655c61aafc7861968..f4f4ecb11b587c74a009c94cb7b230e7c93590e4 100644 (file)
--- a/builtin-grep.c
+++ b/builtin-grep.c
continue;
}
if (!strcmp("-l", arg) ||
+ !strcmp("--name-only", arg) ||
!strcmp("--files-with-matches", arg)) {
opt.name_only = 1;
continue;