diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-09-18 14:37:53 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-18 14:37:54 -0700 |
commit | 3d7535e42496a5b24d8cb17da1a332759928bd35 (patch) | |
tree | 9139e1d1e3fb7d3cbe75c0aefe7cd07f6fd28034 /builtin/grep.c | |
parent | 06e211acc61c52a2e1709ea8b62a0b0f6dcb492b (diff) | |
parent | 39f2e017203695b9da2ad35589b0e58bcac6fdc8 (diff) | |
download | git-3d7535e42496a5b24d8cb17da1a332759928bd35.tar.gz |
Merge branch 'jc/maint-log-grep-all-match'
Fix a long-standing bug in "git log --grep" when multiple "--grep"
are used together with "--all-match" and "--author" or "--committer".
* jc/maint-log-grep-all-match:
t7810-grep: test --all-match with multiple --grep and --author options
t7810-grep: test interaction of multiple --grep and --author options
t7810-grep: test multiple --author with --all-match
t7810-grep: test multiple --grep with and without --all-match
t7810-grep: bring log --grep tests in common form
grep.c: mark private file-scope symbols as static
log: document use of multiple commit limiting options
log --grep/--author: honor --all-match honored for multiple --grep patterns
grep: show --debug output only once
grep: teach --debug option to dump the parse tree
Diffstat (limited to 'builtin/grep.c')
-rw-r--r-- | builtin/grep.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/grep.c b/builtin/grep.c index 09ca4c980e..82530a61b4 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -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"), |