Re: [PATCH] builtin/config.c: prefer `--type=bool` over `--bool`, etc.
From: Junio C Hamano <hidden>
Date: 2018-03-29 20:18:11
Taylor Blau [off-list ref] writes:
`git config` has long allowed the ability for callers to provide a 'type specifier', which instructs `git config` to (1) ensure that incoming values are satisfiable under that type, and (2) that outgoing values are canonicalized under that type. In another series, we propose to add extend this functionality with `--color` and `--default` to replace `--get-color`. However, we traditionally use `--color` to mean "colorize this output", instead of "this value should be treated as a color". Currently, `git config` does not support this kind of colorization, but we should be careful to avoid inhabiting this option too soon, so that `git config` can support `--color` (in the traditional sense) in the future, if that is desired.
OK.
In this patch, we prefer `--type=[int|bool|bool-or-int|...]` over `--int`, `--bool`, and etc. This allows the aforementioned other patch to add `--color` (in the non-traditional sense) via `--type=color`, instead of `--color`.
OK, it's not just "we prefer" but we add this new "--type" thing, so that we do not have to worry about having to make --color and other "types" into double-dash options. Makes good sense, I would guess.