From: Jeff King Date: Thu, 05 Apr 2018 22:40:51 GMT Subject: Re: [PATCH v4 2/2] builtin/config.c: prefer `--type=bool` over `--bool`, etc. Message-ID: <20180405224051.GF29117@sigill.intra.peff.net> In-Reply-To: On Thu, Apr 05, 2018 at 06:29:18PM -0400, Eric Sunshine wrote: > > +ensure that the variable(s) are of the given type and convert the value to the > > +canonical form. If no type specifier is passed, no checks or transformations are > > +performed on the value. > > @@ -160,30 +158,34 @@ See also <>. > > --list:: > > List all variables set in config file, along with their values. > > > > ---bool:: > > - 'git config' will ensure that the output is "true" or "false" > > +--type :: > > + 'git config' will ensure that any input output is valid under the given type > > + constraint(s), and will canonicalize outgoing values in ``'s canonical > > + form. > > In response to my question[2] about whether the typesetting "[type]" > meant that it was optional, you responded[1] that it was not, thus > correctly changed the typesetting to "". However... Right, "--type" without a specifier means nothing (also, I missed this in my review, but "input output" in the quoted text?) > > diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh > > @@ -1622,4 +1623,21 @@ test_expect_success 'later legacy specifiers are given precedence' ' > > +test_expect_success '--no-type unsets type specifiers' ' > > + echo "10" > expect && > > + git config --type=bool --no-type core.number >actual && > > + test_cmp expect actual > > +' > > What does --no-type mean and why is it being tested? If this is an > explicitly supported user-facing option, should it be documented? If > it's not meant to be user-facing, then why are we enforcing its > presence and behavior via a test? It would be the same as if no --type option had been given. The current documentation says: If no type specifier is passed, no checks or transformations are performed on the value. That's retained in the DESCRIPTION section, but it may be worth a mention of the "--no-type" behavior in the OPTIONS section, too. I dunno. -Peff