aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-07-14 11:19:25 -0700
committerJunio C Hamano <gitster@pobox.com>2025-07-14 11:19:26 -0700
commita35b8c8b9e4609351316239cf31835803c7aa452 (patch)
tree7a419a2460b69ffefbd4ce23a9befaee0b22941a
parentdb4a912c4ab822d494ba0a1695d6a0e731dde0ca (diff)
parentc4e9775c60b880f06054c22f98520bdb4f1ba38e (diff)
downloadgit-a35b8c8b9e4609351316239cf31835803c7aa452.tar.gz
Merge branch 'kh/doc-config-subcommands'
Documentation updates. * kh/doc-config-subcommands: config: mention --url in the synopsis config: use --value instead of value-pattern config: document --[no-]value config: use --value=<pattern> consistently config: document --[no-]show-names
-rw-r--r--Documentation/git-config.adoc28
-rw-r--r--builtin/config.c12
2 files changed, 27 insertions, 13 deletions
diff --git a/Documentation/git-config.adoc b/Documentation/git-config.adoc
index 936e0c5130..511b2e26bf 100644
--- a/Documentation/git-config.adoc
+++ b/Documentation/git-config.adoc
@@ -10,9 +10,9 @@ SYNOPSIS
--------
[verse]
'git config list' [<file-option>] [<display-option>] [--includes]
-'git config get' [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<value>] [--fixed-value] [--default=<default>] <name>
-'git config set' [<file-option>] [--type=<type>] [--all] [--value=<value>] [--fixed-value] <name> <value>
-'git config unset' [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>
+'git config get' [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<pattern>] [--fixed-value] [--default=<default>] [--url=<url>] <name>
+'git config set' [<file-option>] [--type=<type>] [--all] [--value=<pattern>] [--fixed-value] <name> <value>
+'git config unset' [<file-option>] [--all] [--value=<pattern>] [--fixed-value] <name>
'git config rename-section' [<file-option>] <old-name> <new-name>
'git config remove-section' [<file-option>] <name>
'git config edit' [<file-option>]
@@ -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=<pattern>` (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=<pattern>`).
--append::
Adds a new line to the option without altering any existing
@@ -200,11 +200,19 @@ See also <<FILES>>.
section in linkgit:gitrevisions[7] for a more complete list of
ways to spell blob names.
+`--value=<pattern>`::
+`--no-value`::
+ With `get`, `set`, and `unset`, match only against
+ _<pattern>_. The pattern is an extended regular expression unless
+ `--fixed-value` is given.
++
+Use `--no-value` to unset _<pattern>_.
+
--fixed-value::
- When used with the `value-pattern` argument, treat `value-pattern` as
+ When used with `--value=<pattern>`, treat _<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`.
+ is exactly equal to _<pattern>_.
--type <type>::
'git config' will ensure that any input or output is valid under the given
@@ -259,6 +267,12 @@ Valid `<type>`'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 _<name>_.
+
--show-origin::
Augment the output of all queried config options with the
origin type (file, standard input, blob, command line) and
diff --git a/builtin/config.c b/builtin/config.c
index f70d635477..5efe273010 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -17,9 +17,9 @@
static const char *const builtin_config_usage[] = {
N_("git config list [<file-option>] [<display-option>] [--includes]"),
- N_("git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<value>] [--fixed-value] [--default=<default>] <name>"),
- N_("git config set [<file-option>] [--type=<type>] [--all] [--value=<value>] [--fixed-value] <name> <value>"),
- N_("git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>"),
+ N_("git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<pattern>] [--fixed-value] [--default=<default>] [--url=<url>] <name>"),
+ N_("git config set [<file-option>] [--type=<type>] [--all] [--value=<pattern>] [--fixed-value] <name> <value>"),
+ N_("git config unset [<file-option>] [--all] [--value=<pattern>] [--fixed-value] <name>"),
N_("git config rename-section [<file-option>] <old-name> <new-name>"),
N_("git config remove-section [<file-option>] <name>"),
N_("git config edit [<file-option>]"),
@@ -33,17 +33,17 @@ static const char *const builtin_config_list_usage[] = {
};
static const char *const builtin_config_get_usage[] = {
- N_("git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp=<regexp>] [--value=<value>] [--fixed-value] [--default=<default>] <name>"),
+ N_("git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp=<regexp>] [--value=<pattern>] [--fixed-value] [--default=<default>] <name>"),
NULL
};
static const char *const builtin_config_set_usage[] = {
- N_("git config set [<file-option>] [--type=<type>] [--comment=<message>] [--all] [--value=<value>] [--fixed-value] <name> <value>"),
+ N_("git config set [<file-option>] [--type=<type>] [--comment=<message>] [--all] [--value=<pattern>] [--fixed-value] <name> <value>"),
NULL
};
static const char *const builtin_config_unset_usage[] = {
- N_("git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>"),
+ N_("git config unset [<file-option>] [--all] [--value=<pattern>] [--fixed-value] <name>"),
NULL
};