diff options
author | Taylor Blau <me@ttaylorr.com> | 2018-06-22 17:49:49 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-06-22 21:59:02 +0200 |
commit | 6653fec3bb969d8be3987cf77654c0aa1778b6b5 (patch) | |
tree | 81d9b314ea5afdb2b02086b8df7fc35d584508f0 /grep.c | |
parent | builtin/grep.c: add '--column' option to 'git-grep(1)' (diff) | |
download | git-6653fec3bb969d8be3987cf77654c0aa1778b6b5.tar.xz git-6653fec3bb969d8be3987cf77654c0aa1778b6b5.zip |
grep.c: add configuration variables to show matched option
To support git-grep(1)'s new option, '--column', document and teach
grep.c how to interpret relevant configuration options, similar to those
associated with '--line-number'.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | grep.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -96,6 +96,10 @@ int grep_config(const char *var, const char *value, void *cb) opt->linenum = git_config_bool(var, value); return 0; } + if (!strcmp(var, "grep.column")) { + opt->columnnum = git_config_bool(var, value); + return 0; + } if (!strcmp(var, "grep.fullname")) { opt->relative = !git_config_bool(var, value); @@ -112,6 +116,8 @@ int grep_config(const char *var, const char *value, void *cb) color = opt->color_function; else if (!strcmp(var, "color.grep.linenumber")) color = opt->color_lineno; + else if (!strcmp(var, "color.grep.column")) + color = opt->color_columnno; else if (!strcmp(var, "color.grep.matchcontext")) color = opt->color_match_context; else if (!strcmp(var, "color.grep.matchselected")) |