Merge branch 'rs/grep-color-words'
authorJunio C Hamano <gitster@pobox.com>
Fri, 31 Oct 2014 18:49:37 +0000 (11:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 31 Oct 2014 18:49:47 +0000 (11:49 -0700)
Allow painting or not painting (partial) matches in context lines
when showing "grep -C<num>" output in color.

* rs/grep-color-words:
  grep: add color.grep.matchcontext and color.grep.matchselected

1  2 
Documentation/config.txt
grep.c
t/t7810-grep.sh

Simple merge
diff --cc grep.c
--- 1/grep.c
--- 2/grep.c
+++ b/grep.c
@@@ -107,6 -105,14 +110,14 @@@ int grep_config(const char *var, const 
                color = opt->color_selected;
        else if (!strcmp(var, "color.grep.separator"))
                color = opt->color_sep;
 -              color_parse(value, var, opt->color_match_context);
 -              color_parse(value, var, opt->color_match_selected);
+       else if (!strcmp(var, "color.grep.match")) {
+               int rc = 0;
+               if (!value)
+                       return config_error_nonbool(var);
++              rc |= color_parse(value, opt->color_match_context);
++              rc |= color_parse(value, opt->color_match_selected);
+               return rc;
+       }
  
        if (color) {
                if (!value)
diff --cc t/t7810-grep.sh
Simple merge