Update grep internal for grepping only in head/body

This further updates the built-in grep engine so that we can say
something like "this pattern should match only in head".  This
can be used to simplify grepping in the log messages.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano
2006-09-20 12:39:46 -07:00
parent a2ed6ae402
commit 480c1ca6fd
2 changed files with 42 additions and 16 deletions

7
grep.h
View File

@ -3,6 +3,8 @@
enum grep_pat_token {
GREP_PATTERN,
GREP_PATTERN_HEAD,
GREP_PATTERN_BODY,
GREP_AND,
GREP_OPEN_PAREN,
GREP_CLOSE_PAREN,
@ -10,6 +12,11 @@ enum grep_pat_token {
GREP_OR,
};
enum grep_context {
GREP_CONTEXT_HEAD,
GREP_CONTEXT_BODY,
};
struct grep_pat {
struct grep_pat *next;
const char *origin;