summaryrefslogtreecommitdiff
path: root/builtin-grep.c
AgeCommit message (Collapse)AuthorFilesLines
2006-05-03builtin-grep: -L (--files-without-match).Libravatar Junio C Hamano1-0/+20
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-03builtin-grep: binary files -a and -ILibravatar Junio C Hamano1-0/+44
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-03builtin-grep: terminate correctly at EOFLibravatar Junio C Hamano1-0/+2
It barfed and segfaulted with an incomplete line. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-02builtin-grep: tighten path wildcard vs tree traversal.Libravatar Junio C Hamano1-15/+20
The earlier code descended into Documentation/technical when given "Documentation/how*" as the pattern, which was too loose. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-02builtin-grep: support -w (--word-regexp).Libravatar Junio C Hamano1-0/+30
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-02builtin-grep: support -c (--count).Libravatar Junio C Hamano1-1/+20
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-02builtin-grep: allow more than one patterns.Libravatar Junio C Hamano1-21/+51
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-02builtin-grep: allow -<n> and -[ABC]<n> notation for context lines.Libravatar Junio C Hamano1-6/+22
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-02builtin-grep: printf %.*s length is int, not ptrdiff_t.Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-01builtin-grep: do not use setup_revisions()Libravatar Junio C Hamano1-121/+134
Grep may want to grok multiple revisions, but it does not make much sense to walk revisions while doing so. This stops calling the code to parse parameters for the revision walker. The parameter parsing for the optional "-e" option becomes a lot simpler with it as well. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-01builtin-grep: support '-l' option.Libravatar Junio C Hamano1-0/+10
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-01builtin-grep: wildcard pathspec fixesLibravatar Junio C Hamano1-23/+62
This tweaks the pathspec wildcard used in builtin-grep to match that of ls-files. With this: git grep -e DEBUG -- '*/Kconfig*' would work like the shell script version, and you could even do: git grep -e DEBUG --cached -- '*/Kconfig*' ;# from index git grep -e DEBUG v2.6.12 -- '*/Kconfig*' ;# from rev Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-01built-in "git grep"Libravatar Junio C Hamano1-0/+454
This attempts to set up built-in "git grep" to further reduce our dependence on the shell, while at the same time optionally allowing to run grep against object database. You could do funky things like these: git grep --cached -e pattern ;# grep from index git grep -e pattern master ;# or in a rev git grep -e pattern master next ;# or in multiple revs git grep -e pattern pu^@ ;# even like this with an ;# extension from another topic ;-) git grep -e pattern master..next ;# or even from rev ranges git grep -e pattern master~20:Documentation ;# or an arbitrary tree git grep -e pattern next:git-commit.sh ;# or an arbitrary blob Right now, it does not understand and/or obey many options grep should accept, and the pattern must be given with -e option due to the way the parameter parser is structured, both of which obviously need to be fixed for usability. But this is going in the right direction. The shell script version is one of the worst Portability offender in the git barebone Porcelainish; it uses xargs -0 to pass paths around and shell arrays to sift flags and parameters. Signed-off-by: Junio C Hamano <junkio@cox.net>