author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 7 Mar 2009 12:34:46 +0000 (13:34 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 7 Mar 2009 19:34:59 +0000 (11:34 -0800) | ||
commit | a94982ef39e1bb9a6f782b5b6ced22e97d6859b5 | |
tree | ab9a91565f8f37ce24eb8b89faa1e685ef1f1933 | tree | snapshot |
parent | 7e8f59d577e5615ceff06da0d9dde36a63608d53 | commit | diff |
grep: add support for coloring with external greps
Add the config variable color.grep.external, which can be used to
switch on coloring of external greps. To enable auto coloring with
GNU grep, one needs to set color.grep.external to --color=always to
defeat the pager started by git grep. The value of the config
variable will be passed to the external grep only if it would
colorize internal grep's output, so automatic terminal detected
works. The default is to not pass any option, because the external
grep command could be a program without color support.
Also set the environment variables GREP_COLOR and GREP_COLORS to
pass the configured color for matches to the external grep. This
works with GNU grep; other variables could be added as needed.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Add the config variable color.grep.external, which can be used to
switch on coloring of external greps. To enable auto coloring with
GNU grep, one needs to set color.grep.external to --color=always to
defeat the pager started by git grep. The value of the config
variable will be passed to the external grep only if it would
colorize internal grep's output, so automatic terminal detected
works. The default is to not pass any option, because the external
grep command could be a program without color support.
Also set the environment variables GREP_COLOR and GREP_COLORS to
pass the configured color for matches to the external grep. This
works with GNU grep; other variables could be added as needed.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt | diff | blob | history | |
builtin-grep.c | diff | blob | history | |
grep.h | diff | blob | history |