OSDN Git Service

grep: show --debug output only once
authorMichael J Gruber <git@drmicha.warpmail.net>
Fri, 14 Sep 2012 09:46:35 +0000 (11:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Sep 2012 17:11:44 +0000 (10:11 -0700)
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>
builtin/grep.c

index 8aea00c..a7e8df0 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);