summaryrefslogtreecommitdiff
path: root/grep.c
diff options
context:
space:
mode:
authorBeat Bolli <dev+git@drbeat.li>2019-08-18 20:17:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-19 22:24:48 (GMT)
commitc581e4a7499b9e1089847dbbc057afbef1ed861e (patch)
tree265e977053958f165e2e14ca7e807c1f24d45354 /grep.c
parent870eea81669bfff4333b37b11fedd870cd05fd90 (diff)
downloadgit-c581e4a7499b9e1089847dbbc057afbef1ed861e.zip
git-c581e4a7499b9e1089847dbbc057afbef1ed861e.tar.gz
git-c581e4a7499b9e1089847dbbc057afbef1ed861e.tar.bz2
grep: under --debug, show whether PCRE JIT is enabled
This information is useful and not visible anywhere else, so show it. Signed-off-by: Beat Bolli <dev+git@drbeat.li> Suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.c')
-rw-r--r--grep.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/grep.c b/grep.c
index c7c06ae..7608878 100644
--- a/grep.c
+++ b/grep.c
@@ -394,6 +394,8 @@ static void compile_pcre1_regexp(struct grep_pat *p, const struct grep_opt *opt)
#ifdef GIT_PCRE1_USE_JIT
pcre_config(PCRE_CONFIG_JIT, &p->pcre1_jit_on);
+ if (opt->debug)
+ fprintf(stderr, "pcre1_jit_on=%d\n", p->pcre1_jit_on);
#endif
}
@@ -490,6 +492,8 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt
}
pcre2_config(PCRE2_CONFIG_JIT, &p->pcre2_jit_on);
+ if (opt->debug)
+ fprintf(stderr, "pcre2_jit_on=%d\n", p->pcre2_jit_on);
if (p->pcre2_jit_on) {
jitret = pcre2_jit_compile(p->pcre2_pattern, PCRE2_JIT_COMPLETE);
if (jitret)
@@ -515,6 +519,9 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt
BUG("pcre2_pattern_info() failed: %d", patinforet);
if (jitsizearg == 0) {
p->pcre2_jit_on = 0;
+ if (opt->debug)
+ fprintf(stderr, "pcre2_jit_on=%d: (*NO_JIT) in regex\n",
+ p->pcre2_jit_on);
return;
}
}