]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/grep.c
grep: teach --untracked and --exclude-standard options
authorJunio C Hamano <gitster@pobox.com>
Tue, 27 Sep 2011 20:43:12 +0000 (13:43 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Oct 2011 01:33:45 +0000 (18:33 -0700)
commit0a93fb8a9cc6fa1bf7dba6b498cba3f57f5017a1
tree50daede8ecb40d0cff0c0968cd9d3337b8d520b3
parenta9e643668aa932d93528fffa573a13a28eb54556
grep: teach --untracked and --exclude-standard options

In a working tree of a git managed repository, "grep --untracked" would
find the specified patterns from files in untracked files in addition to
its usual behaviour of finding them in the tracked files.

By default, when working with "--no-index" option, "grep" does not pay
attention to .gitignore mechanism. "grep --no-index --exclude-standard"
can be used to tell the command to use .gitignore and stop reporting hits
from files that would be ignored. Also, when working without "--no-index",
"grep" honors .gitignore mechanism, and "grep --no-exclude-standard" can
be used to tell the command to include hits from files that are ignored.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-grep.txt
builtin-grep.c
t/t7002-grep.sh