]> git.ipfire.org Git - thirdparty/git.git/commit - revision.c
grep: teach --debug option to dump the parse tree
authorJunio C Hamano <gitster@pobox.com>
Thu, 13 Sep 2012 21:21:44 +0000 (14:21 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Sep 2012 17:10:35 +0000 (10:10 -0700)
commit17bf35a3c7b46df7131681bcc5bee5f12e1caec4
tree26c22e3e4dce563d22a840d6a9b2f144a2335b57
parent785ee4960c3d334cbc2b17ab74d2cebdf1b4db64
grep: teach --debug option to dump the parse tree

Our "grep" allows complex boolean expressions to be formed to match
each individual line with operators like --and, '(', ')' and --not.
Introduce the "--debug" option to show the parse tree to help people
who want to debug and enhance it.

Also "log" learns "--grep-debug" option to do the same.  The command
line parser to the log family is a lot more limited than the general
"git grep" parser, but it has special handling for header matching
(e.g. "--author"), and a parse tree is valuable when working on it.

Note that "--all-match" is *not* any individual node in the parse
tree.  It is an instruction to the evaluator to check all the nodes
in the top-level backbone have matched and reject a document as
non-matching otherwise.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c
grep.c
grep.h
revision.c