Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-03-16 05:20:04 +0300
committerJunio C Hamano <gitster@pobox.com>2009-03-18 03:03:33 +0300
commit6e89ec0f1e716c11bf7fa214b4c7b975ea77c736 (patch)
tree5620001d0f21798e3e2159be19099bdfe02b591c /builtin-grep.c
parent747a322bcc4df5f9a371890ffe728741456704c7 (diff)
grep: prefer builtin over external one when coloring results
As far as I know, not all grep programs support coloring, so we should rely on builtin grep. If you want external grep, set color.grep.external to empty string. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-grep.c')
-rw-r--r--builtin-grep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-grep.c b/builtin-grep.c
index 9e7e766a49..89489ddcf8 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -825,6 +825,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
}
}
+ if (opt.color && !opt.color_external)
+ builtin_grep = 1;
if (!opt.pattern_list)
die("no pattern given.");
if ((opt.regflags != REG_NEWLINE) && opt.fixed)