Re: [PATCH v3 5/8] config: add --fixed-value option, un-implemented

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 25, 2020 at 5:13 PM Derrick Stolee via GitGitGadget
<gitgitgadget@xxxxxxxxx> wrote:
> [...]
> Add a new '--fixed-value' option that does not currently change the
> behavior. The implementation will be filled in by later changes for
> each appropriate action. For now, check and test that --fixed-value
> will abort the command when included with an incompatible action or
> without a 'value-pattern' argument.
> [...]
> Signed-off-by: Derrick Stolee <dstolee@xxxxxxxxxxxxx>
> ---
> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
> @@ -9,15 +9,15 @@ git-config - Get and set repository or global options
> +'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] --get name [value-pattern]
> +'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] --get-all name [value-pattern]
> +'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] [--name-only] --get-regexp name_regex [value-pattern]

Didn't notice this before (since I wasn't paying close attention), but
portions of the command which are to be filled-in by the user are
normally surrounded by angle brackets. Without the angle brackets, the
interpretation is that the argument is to be typed literally as shown.
So, the above should really be <value-pattern> and <name_regex> (or
even better <name-regex>), just as other fill-in arguments
<file-option> and <type> are formatted already.

I'm not suggesting that this series should tackle such a change since
that would be straying quite far from the original goal (which, as I
recall, was fixing a misbehavior of git-maintenance), but just
pointing out a possible mini-project for someone to tackle at some
point.

> +--fixed-value::
> +       When used with the `value-pattern` argument, treat `value-pattern` as
> +       an exact string instead of a regular expression. This will restrict
> +       the name/value pairs that are matched to only those where the value
> +       is exactly equal to the `value-pattern`.

Likewise, this would also use the angle brackets as `<value-pattern>`
(or '<value-pattern>' with single quotes rather than backquotes, for
which, I believe, Junio recently stated his preference)...

>  --type <type>::
>    'git config' will ensure that any input or output is valid under the given
>    type constraint(s), and will canonicalize outgoing values in `<type>`'s

... just like <type> is shown in angle brackets.

> +       OPT_BOOL(0, "fixed-value", &fixed_value, N_("use string equality when comparing values to 'value-pattern'")),

Here, I think omitting angle brackets is common, so this is probably okay.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux