Re: [PATCHv3 01/11] grep: teach --debug option to dump the parse tree
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 14, 2012, 17:09 UTC
- Message-ID
- <7vr4q45y65.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <eb5e7055691692e8a60adf8edbb3b8d2aab9d02b.1347615361.git.git@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 8 quoted lines
> From: Junio C Hamano <gitster@pobox.com>
>
> 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 "--debug-grep" option to do the same. The commandThis was actually a leftover incorrect message.
When we introduce the equivalent of
$ git grep -e foo --and --not \( -e bar -e baz \)
to the log family in some distant future, we may end up having to disambiguate the "--not" (which means something completely different for the log family) meant for the grep part by doing
$ git log --grep=foo --grep-and --grep-not \
--grep-\( --grep=bar --grep=baz --grep-\)or something like that, and the code says --grep-debug because that would fit better than --debug-grep.
Other than that, the patch looks good ;-)