From 247e2f822e6ccdccaa19ca1a54d4082ce5d819e7 Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Wed, 25 Nov 2020 22:12:50 +0000 Subject: config: replace 'value_regex' with 'value_pattern' The 'value_regex' argument in the 'git config' builtin is poorly named, especially related to an upcoming change that allows exact string matches instead of ERE pattern matches. Perform a mostly mechanical change of every instance of 'value_regex' to 'value_pattern' in the codebase. This is only critical for documentation and error messages, but it is best to be consistent inside the codebase, too. For documentation, use 'value-pattern' which is better punctuation. This affects Documentation/git-config.txt and the usage in builtin/config.c, which was already mixed between 'value_regex' and 'value-regex'. I gave some thought to leaving the value_regex variables inside config.c that are regex_t pointers. However, it is probably best to keep the name consistent with the rest of the variables. This does not update the translations inside the po/ directory, as that creates conflicts with ongoing work. The input strings should automatically update through automation, and a few of the output strings currently use "[value_regex]" directly. Signed-off-by: Derrick Stolee Signed-off-by: Junio C Hamano --- Documentation/git-config.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Documentation/git-config.txt') diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt index 7573160f21..0be5499952 100644 --- a/Documentation/git-config.txt +++ b/Documentation/git-config.txt @@ -9,15 +9,15 @@ git-config - Get and set repository or global options SYNOPSIS -------- [verse] -'git config' [] [--type=] [--show-origin] [--show-scope] [-z|--null] name [value [value_regex]] +'git config' [] [--type=] [--show-origin] [--show-scope] [-z|--null] name [value [value-pattern]] 'git config' [] [--type=] --add name value -'git config' [] [--type=] --replace-all name value [value_regex] -'git config' [] [--type=] [--show-origin] [--show-scope] [-z|--null] --get name [value_regex] -'git config' [] [--type=] [--show-origin] [--show-scope] [-z|--null] --get-all name [value_regex] -'git config' [] [--type=] [--show-origin] [--show-scope] [-z|--null] [--name-only] --get-regexp name_regex [value_regex] +'git config' [] [--type=] --replace-all name value [value-pattern] +'git config' [] [--type=] [--show-origin] [--show-scope] [-z|--null] --get name [value-pattern] +'git config' [] [--type=] [--show-origin] [--show-scope] [-z|--null] --get-all name [value-pattern] +'git config' [] [--type=] [--show-origin] [--show-scope] [-z|--null] [--name-only] --get-regexp name_regex [value-pattern] 'git config' [] [--type=] [-z|--null] --get-urlmatch name URL -'git config' [] --unset name [value_regex] -'git config' [] --unset-all name [value_regex] +'git config' [] --unset name [value-pattern] +'git config' [] --unset-all name [value-pattern] 'git config' [] --rename-section old_name new_name 'git config' [] --remove-section name 'git config' [] [--show-origin] [--show-scope] [-z|--null] [--name-only] -l | --list @@ -33,7 +33,7 @@ escaped. Multiple lines can be added to an option by using the `--add` option. If you want to update or unset an option which can occur on multiple -lines, a POSIX regexp `value_regex` needs to be given. Only the +lines, a POSIX regexp `value-pattern` needs to be given. Only the existing values that match the regexp are updated or unset. If you want to handle the lines that do *not* match the regex, just prepend a single exclamation mark in front (see also <>). @@ -73,11 +73,11 @@ OPTIONS --replace-all:: Default behavior is to replace at most one line. This replaces - all lines matching the key (and optionally the value_regex). + all lines matching the key (and optionally the `value-pattern`). --add:: Adds a new line to the option without altering any existing - values. This is the same as providing '^$' as the value_regex + values. This is the same as providing '^$' as the `value-pattern` in `--replace-all`. --get:: -- cgit v1.2.3