Merge branch 'jc/maint-log-grep-all-match'
[git.git] / builtin / grep.c
index 09ca4c980e633895dd104307e76770da3f208a06..82530a61b483738382c810bcb141e33b06729d6f 100644 (file)
@@ -209,6 +209,7 @@ static void start_threads(struct grep_opt *opt)
                int err;
                struct grep_opt *o = grep_opt_dup(opt);
                o->output = strbuf_out;
+               o->debug = 0;
                compile_grep_patterns(o);
                err = pthread_create(&threads[i], NULL, run, o);
 
@@ -817,6 +818,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
                           N_("indicate hit with exit status without output")),
                OPT_BOOLEAN(0, "all-match", &opt.all_match,
                        N_("show only matches from files that match all patterns")),
+               { OPTION_SET_INT, 0, "debug", &opt.debug, NULL,
+                 N_("show parse tree for grep expression"),
+                 PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1 },
                OPT_GROUP(""),
                { OPTION_STRING, 'O', "open-files-in-pager", &show_in_pager,
                        N_("pager"), N_("show matching files in the pager"),