From: Junio C Hamano Date: Tue, 12 Jan 2010 08:31:38 GMT Subject: [PATCH] grep: lookahead optimization can be used with -L option Message-ID: <7v1vhv4tcl.fsf_-_@alter.siamese.dyndns.org> In-Reply-To: <7v63774tfd.fsf@alter.siamese.dyndns.org> This is not an "inverted logic" option ("-v") that shows lines that do not match given pattern as hits, and skipping lines that cannot possibly match wouldn't change its outcome. Signed-off-by: Junio C Hamano --- * Should be squashed in to the "lookahead" patch. grep.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/grep.c b/grep.c index 048b982..03ffcd4 100644 --- a/grep.c +++ b/grep.c @@ -614,7 +614,7 @@ static int should_lookahead(struct grep_opt *opt) if (opt->extended) return 0; /* punt for too complex stuff */ - if (opt->invert || opt->unmatch_name_only) + if (opt->invert) return 0; for (p = opt->pattern_list; p; p = p->next) { if (p->token != GREP_PATTERN) -- 1.6.6.280.ge295b7.dirty