diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2009-07-02 00:07:24 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-07-01 19:16:50 -0700 |
commit | 60ecac98ed6f420c6bf823491074219087c749d4 (patch) | |
tree | 480471031679f5d7f88dea0c673412f1ce03890b /builtin-grep.c | |
parent | 2944e4e6145bdfcb1a8730d7da671786d72c86ed (diff) | |
download | git-60ecac98ed6f420c6bf823491074219087c749d4.tar.gz git-60ecac98ed6f420c6bf823491074219087c749d4.tar.xz |
grep -p: support user defined regular expressions
Respect the userdiff attributes and config settings when looking for
lines with function definitions in git grep -p.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-grep.c')
-rw-r--r-- | builtin-grep.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin-grep.c b/builtin-grep.c index 037452ec7..9343cc5e5 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -11,6 +11,7 @@ #include "tree-walk.h" #include "builtin.h" #include "parse-options.h" +#include "userdiff.h" #include "grep.h" #ifndef NO_EXTERNAL_GREP @@ -30,6 +31,12 @@ static int grep_config(const char *var, const char *value, void *cb) { struct grep_opt *opt = cb; + switch (userdiff_config(var, value)) { + case 0: break; + case -1: return -1; + default: return 0; + } + if (!strcmp(var, "color.grep")) { opt->color = git_config_colorbool(var, value, -1); return 0; |