Skip to content

Commit

Permalink
grep: show --debug output only once
Browse files Browse the repository at this point in the history
When threaded grep is in effect, the patterns are duplicated and
recompiled for each thread. Avoid "--debug" output during the
recompilation so that the output is given once instead of "1+nthreads"
times.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael J Gruber authored and Junio C Hamano committed Sep 14, 2012
1 parent 17bf35a commit 208f5aa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions builtin/grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 208f5aa

Please sign in to comment.