@matheusbsbs / matheus-bagliano / commits / 6e89ec0f1e
Fork 0

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>

Nguyễn Thái Ngọc Duy committed Mar 16, 2009 at 13:20 UTC 6e89ec0f1e716c11bf7fa214b4c7b975ea77c736
1 file changed +2
builtin-grep.c
+2
@@ -825,6 +825,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
825 }
826 }
827
828 + if (opt.color && !opt.color_external)
829 + builtin_grep = 1;
830 if (!opt.pattern_list)
831 die("no pattern given.");
832 if ((opt.regflags != REG_NEWLINE) && opt.fixed)