On Wed, Apr 4, 2018 at 10:00 PM, Taylor Blau <[email protected]> wrote:
> [...]
> In this patch, we prefer `--type=[int|bool|bool-or-int|...]` over
> `--int`, `--bool`, and etc. This allows the aforementioned upcoming
> patch to support querying a color value with a default via `--type=color
> --default=....`
>
> Signed-off-by: Taylor Blau <[email protected]>
> ---
> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
> @@ -38,12 +38,10 @@ existing values that match the regexp are updated or
> unset. If
> +A type specifier may be given as an argument to `--type` to make 'git config'
In [1], you said that the argument to --type is required, so use of
"may be given" here is ambiguous; it makes it sound as if the argument
is optional. Perhaps rewrite something like:
The --type option requests `git config` to ...
Not necessarily worth a re-roll, though. (But if you do need to
re-roll for some reason, it might make sense to combine this series
with the --default series to make it slightly easier to review them
together -- since the one depends upon the other -- and probably ease
the burden on Junio slightly.)
> +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 <<FILES>>.
> --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 <type>::
> + 'git config' will ensure that any input output is valid under the given
> type
> + constraint(s), and will canonicalize outgoing values in `<type>`'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 "<type>". However...
> 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?
[1]: https://public-inbox.org/git/[email protected]/
[2]:
https://public-inbox.org/git/CAPig+cR4uFiC_gFsb2e9JR6SdP-wUQVz-E0MjRHR=vnhd+h...@mail.gmail.com/