From: Joe Ratterman Date: Mon, 28 Mar 2011 22:41:16 GMT Subject: Re: [PATCH] grep: allow -E and -n to be turned on by default via configuration Message-ID: In-Reply-To: <7vbp0ux5c9.fsf_-_@alter.siamese.dyndns.org> On Mon, Mar 28, 2011 at 5:12 PM, Junio C Hamano wrote: > +grep.lineNumbers:: > +       If set to true, enable '-n' option by default. > + > +grep.extendedRegexp:: > +       If set to true, enable '--extended-regexp' option by default. > + I know my original patch was plural, but I since noticed that the GNU grep --line-number option is singular. I used the same thing in my patch to add that option to git grep. Should this one be singular? > +grep.lineNumbers:: > +       If set to true, enable '-n' option by default. > + > +grep.extendedRegexp:: > +       If set to true, enable '--extended-regexp' option by default. > + > + ... > +       if (!strcmp(var, "grep.extendedregexp")) { > +               opt->regflags |= git_config_bool(var, value) ? REG_EXTENDED : 0; > +               return 0; > +       } > + > +       if (!strcmp(var, "grep.linenumbers")) { > +               opt->linenum = git_config_bool(var, value); We need to match the case between the docs and the code or use strcasecmp(). Most config options I could find used all lower-case. Joe