From 88a4ed40c0056eb6563f50ac41f5c09e7aedc418 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Tue, 1 Jul 2025 17:14:28 +0200 Subject: [PATCH 1/5] config: document --[no-]show-names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These options were introduced in 4e513890008 (builtin/config: introduce "get" subcommand, 2024-05-06) but not documented here. Use the description from the source code. Document this option and the negated form according to the current convention.[1] `--show-names` is also the default when `--get-regexp` is given. But don’t mention it here since all the deprecated modes are quarantined in the “Deprecated Modes” section. [1]: https://lore.kernel.org/git/xmqqcyct1mtq.fsf@gitster.g/ Acked-by: Patrick Steinhardt Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-config.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/git-config.adoc b/Documentation/git-config.adoc index 936e0c5130..e05bf813d4 100644 --- a/Documentation/git-config.adoc +++ b/Documentation/git-config.adoc @@ -259,6 +259,12 @@ Valid ``'s include: Output only the names of config variables for `list` or `get`. +`--show-names`:: +`--no-show-names`:: + With `get`, show config keys in addition to their values. The + default is `--no-show-names` unless `--url` is given and there + are no subsections in __. + --show-origin:: Augment the output of all queried config options with the origin type (file, standard input, blob, command line) and From f322f86e30b7667ef0ae519ff87796b2f0a0632d Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Tue, 1 Jul 2025 17:14:29 +0200 Subject: [PATCH 2/5] config: use --value= consistently MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This option was introduced in a series of commits from fe3ccc7aab (Merge branch 'ps/config-subcommands', 2024-05-15). But two styles were used for the value provided to the option: 1. Synopsis: `--value=` 2. Deprecated Modes: `--value=` (2) is also used in the synopsis on the command. Use (2) consistently throughout since it’s a pattern in the general case (`value` sounds more generic). Acked-by: Patrick Steinhardt Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-config.adoc | 6 +++--- builtin/config.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Documentation/git-config.adoc b/Documentation/git-config.adoc index e05bf813d4..d3ddc53855 100644 --- a/Documentation/git-config.adoc +++ b/Documentation/git-config.adoc @@ -10,9 +10,9 @@ SYNOPSIS -------- [verse] 'git config list' [] [] [--includes] -'git config get' [] [] [--includes] [--all] [--regexp] [--value=] [--fixed-value] [--default=] -'git config set' [] [--type=] [--all] [--value=] [--fixed-value] -'git config unset' [] [--all] [--value=] [--fixed-value] +'git config get' [] [] [--includes] [--all] [--regexp] [--value=] [--fixed-value] [--default=] +'git config set' [] [--type=] [--all] [--value=] [--fixed-value] +'git config unset' [] [--all] [--value=] [--fixed-value] 'git config rename-section' [] 'git config remove-section' [] 'git config edit' [] diff --git a/builtin/config.c b/builtin/config.c index f70d635477..706269647e 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -17,9 +17,9 @@ static const char *const builtin_config_usage[] = { N_("git config list [] [] [--includes]"), - N_("git config get [] [] [--includes] [--all] [--regexp] [--value=] [--fixed-value] [--default=] "), - N_("git config set [] [--type=] [--all] [--value=] [--fixed-value] "), - N_("git config unset [] [--all] [--value=] [--fixed-value] "), + N_("git config get [] [] [--includes] [--all] [--regexp] [--value=] [--fixed-value] [--default=] "), + N_("git config set [] [--type=] [--all] [--value=] [--fixed-value] "), + N_("git config unset [] [--all] [--value=] [--fixed-value] "), N_("git config rename-section [] "), N_("git config remove-section [] "), N_("git config edit []"), @@ -33,17 +33,17 @@ static const char *const builtin_config_list_usage[] = { }; static const char *const builtin_config_get_usage[] = { - N_("git config get [] [] [--includes] [--all] [--regexp=] [--value=] [--fixed-value] [--default=] "), + N_("git config get [] [] [--includes] [--all] [--regexp=] [--value=] [--fixed-value] [--default=] "), NULL }; static const char *const builtin_config_set_usage[] = { - N_("git config set [] [--type=] [--comment=] [--all] [--value=] [--fixed-value] "), + N_("git config set [] [--type=] [--comment=] [--all] [--value=] [--fixed-value] "), NULL }; static const char *const builtin_config_unset_usage[] = { - N_("git config unset [] [--all] [--value=] [--fixed-value] "), + N_("git config unset [] [--all] [--value=] [--fixed-value] "), NULL }; From 5ba6e6cfe3c6279019d8a1d915bd0e9f35b177c4 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Tue, 1 Jul 2025 17:14:30 +0200 Subject: [PATCH 3/5] config: document --[no-]value These options were introduced in a series of commits from fe3ccc7aab (Merge branch 'ps/config-subcommands', 2024-05-15).[1] But they were not documented here. Document this option and the negated form according to the current convention.[2] [1]: `--value` is a replacement for the `value-pattern` positional argument [2]: https://lore.kernel.org/git/xmqqcyct1mtq.fsf@gitster.g/ Acked-by: Patrick Steinhardt Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-config.adoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/git-config.adoc b/Documentation/git-config.adoc index d3ddc53855..03808b18d3 100644 --- a/Documentation/git-config.adoc +++ b/Documentation/git-config.adoc @@ -200,6 +200,14 @@ See also <>. section in linkgit:gitrevisions[7] for a more complete list of ways to spell blob names. +`--value=`:: +`--no-value`:: + With `get`, `set`, and `unset`, match only against + __. The pattern is an extended regular expression unless + `--fixed-value` is given. ++ +Use `--no-value` to unset __. + --fixed-value:: When used with the `value-pattern` argument, treat `value-pattern` as an exact string instead of a regular expression. This will restrict From d46f69862645e31cbf25c8bb53f0761f03860533 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Tue, 1 Jul 2025 17:14:31 +0200 Subject: [PATCH 4/5] config: use --value instead of value-pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This option was introduced in a series of commits from fe3ccc7aab (Merge branch 'ps/config-subcommands', 2024-05-15) and deprecated `value-pattern`. But `value-pattern` is still used throughout the doc. The deprecated modes have been quarantined in the “Deprecated Modes” section. So let’s only use `--value=` in the rest of the doc. Acked-by: Patrick Steinhardt Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-config.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/git-config.adoc b/Documentation/git-config.adoc index 03808b18d3..9d8f9bb04e 100644 --- a/Documentation/git-config.adoc +++ b/Documentation/git-config.adoc @@ -26,7 +26,7 @@ escaped. Multiple lines can be added to an option by using the `--append` option. If you want to update or unset an option which can occur on multiple -lines, a `value-pattern` (which is an extended regular expression, +lines, `--value=` (which is an extended regular expression, unless the `--fixed-value` option is given) needs to be given. Only the existing values that match the pattern are updated or unset. If you want to handle the lines that do *not* match the pattern, just @@ -109,7 +109,7 @@ OPTIONS --replace-all:: Default behavior is to replace at most one line. This replaces - all lines matching the key (and optionally the `value-pattern`). + all lines matching the key (and optionally `--value=`). --append:: Adds a new line to the option without altering any existing @@ -209,10 +209,10 @@ See also <>. Use `--no-value` to unset __. --fixed-value:: - When used with the `value-pattern` argument, treat `value-pattern` as + When used with `--value=`, treat __ 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`. + is exactly equal to __. --type :: 'git config' will ensure that any input or output is valid under the given From c4e9775c60b880f06054c22f98520bdb4f1ba38e Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Tue, 1 Jul 2025 17:14:32 +0200 Subject: [PATCH 5/5] config: mention --url in the synopsis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 4e513890008 (builtin/config: introduce "get" subcommand, 2024-05-06) introduced `get` and `--url` but didn’t add `--url` to the synopsis. Acked-by: Patrick Steinhardt Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-config.adoc | 2 +- builtin/config.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/git-config.adoc b/Documentation/git-config.adoc index 9d8f9bb04e..511b2e26bf 100644 --- a/Documentation/git-config.adoc +++ b/Documentation/git-config.adoc @@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git config list' [] [] [--includes] -'git config get' [] [] [--includes] [--all] [--regexp] [--value=] [--fixed-value] [--default=] +'git config get' [] [] [--includes] [--all] [--regexp] [--value=] [--fixed-value] [--default=] [--url=] 'git config set' [] [--type=] [--all] [--value=] [--fixed-value] 'git config unset' [] [--all] [--value=] [--fixed-value] 'git config rename-section' [] diff --git a/builtin/config.c b/builtin/config.c index 706269647e..5efe273010 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -17,7 +17,7 @@ static const char *const builtin_config_usage[] = { N_("git config list [] [] [--includes]"), - N_("git config get [] [] [--includes] [--all] [--regexp] [--value=] [--fixed-value] [--default=] "), + N_("git config get [] [] [--includes] [--all] [--regexp] [--value=] [--fixed-value] [--default=] [--url=] "), N_("git config set [] [--type=] [--all] [--value=] [--fixed-value] "), N_("git config unset [] [--all] [--value=] [--fixed-value] "), N_("git config rename-section [] "),