Re: [PATCH 3/6] grep.[ch]: teach columnnum, color_columnno to grep_opt
- From
- Martin Ågren <martin.agren@gmail.com>
- Date
- Apr 21, 2018, 08:32 UTC
- Message-ID
- <CAN0heSoa2CLNF7vdsmfkc2rbz2XhM_77XnuK9=5wf4LAnmX=Ww@mail.gmail.com>
- In-Reply-To
- <20180421034535.GD24606@syl.local>
On 21 April 2018 at 05:45, Taylor Blau <me@ttaylorr.com> wrote:
Show 21 quoted lines
> diff --git a/grep.c b/grep.c
> index 29bc799ecf..7872a5d868 100644
> --- a/grep.c
> +++ b/grep.c
> @@ -95,6 +95,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.columnnumber")) {
> + opt->columnnum = git_config_bool(var, value);
> + return 0;
> + }
>
> if (!strcmp(var, "grep.fullname")) {
> opt->relative = !git_config_bool(var, value);
> @@ -111,6 +115,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.columnumber"))
> + color = opt->color_columnno;missing 'n' (s/umnum/umnnum/). Those characters are almost perfectly designed for hiding precisely this mistake. ;-)