Skip to content

Commit a35b8c8

Browse files
committed
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
2 parents db4a912 + c4e9775 commit a35b8c8

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

Documentation/git-config.adoc

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ SYNOPSIS
1010
--------
1111
[verse]
1212
'git config list' [<file-option>] [<display-option>] [--includes]
13-
'git config get' [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<value>] [--fixed-value] [--default=<default>] <name>
14-
'git config set' [<file-option>] [--type=<type>] [--all] [--value=<value>] [--fixed-value] <name> <value>
15-
'git config unset' [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>
13+
'git config get' [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<pattern>] [--fixed-value] [--default=<default>] [--url=<url>] <name>
14+
'git config set' [<file-option>] [--type=<type>] [--all] [--value=<pattern>] [--fixed-value] <name> <value>
15+
'git config unset' [<file-option>] [--all] [--value=<pattern>] [--fixed-value] <name>
1616
'git config rename-section' [<file-option>] <old-name> <new-name>
1717
'git config remove-section' [<file-option>] <name>
1818
'git config edit' [<file-option>]
@@ -26,7 +26,7 @@ escaped.
2626

2727
Multiple lines can be added to an option by using the `--append` option.
2828
If you want to update or unset an option which can occur on multiple
29-
lines, a `value-pattern` (which is an extended regular expression,
29+
lines, `--value=<pattern>` (which is an extended regular expression,
3030
unless the `--fixed-value` option is given) needs to be given. Only the
3131
existing values that match the pattern are updated or unset. If
3232
you want to handle the lines that do *not* match the pattern, just
@@ -109,7 +109,7 @@ OPTIONS
109109

110110
--replace-all::
111111
Default behavior is to replace at most one line. This replaces
112-
all lines matching the key (and optionally the `value-pattern`).
112+
all lines matching the key (and optionally `--value=<pattern>`).
113113

114114
--append::
115115
Adds a new line to the option without altering any existing
@@ -200,11 +200,19 @@ See also <<FILES>>.
200200
section in linkgit:gitrevisions[7] for a more complete list of
201201
ways to spell blob names.
202202

203+
`--value=<pattern>`::
204+
`--no-value`::
205+
With `get`, `set`, and `unset`, match only against
206+
_<pattern>_. The pattern is an extended regular expression unless
207+
`--fixed-value` is given.
208+
+
209+
Use `--no-value` to unset _<pattern>_.
210+
203211
--fixed-value::
204-
When used with the `value-pattern` argument, treat `value-pattern` as
212+
When used with `--value=<pattern>`, treat _<pattern>_ as
205213
an exact string instead of a regular expression. This will restrict
206214
the name/value pairs that are matched to only those where the value
207-
is exactly equal to the `value-pattern`.
215+
is exactly equal to _<pattern>_.
208216

209217
--type <type>::
210218
'git config' will ensure that any input or output is valid under the given
@@ -259,6 +267,12 @@ Valid `<type>`'s include:
259267
Output only the names of config variables for `list` or
260268
`get`.
261269

270+
`--show-names`::
271+
`--no-show-names`::
272+
With `get`, show config keys in addition to their values. The
273+
default is `--no-show-names` unless `--url` is given and there
274+
are no subsections in _<name>_.
275+
262276
--show-origin::
263277
Augment the output of all queried config options with the
264278
origin type (file, standard input, blob, command line) and

builtin/config.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
static const char *const builtin_config_usage[] = {
1919
N_("git config list [<file-option>] [<display-option>] [--includes]"),
20-
N_("git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<value>] [--fixed-value] [--default=<default>] <name>"),
21-
N_("git config set [<file-option>] [--type=<type>] [--all] [--value=<value>] [--fixed-value] <name> <value>"),
22-
N_("git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>"),
20+
N_("git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<pattern>] [--fixed-value] [--default=<default>] [--url=<url>] <name>"),
21+
N_("git config set [<file-option>] [--type=<type>] [--all] [--value=<pattern>] [--fixed-value] <name> <value>"),
22+
N_("git config unset [<file-option>] [--all] [--value=<pattern>] [--fixed-value] <name>"),
2323
N_("git config rename-section [<file-option>] <old-name> <new-name>"),
2424
N_("git config remove-section [<file-option>] <name>"),
2525
N_("git config edit [<file-option>]"),
@@ -33,17 +33,17 @@ static const char *const builtin_config_list_usage[] = {
3333
};
3434

3535
static const char *const builtin_config_get_usage[] = {
36-
N_("git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp=<regexp>] [--value=<value>] [--fixed-value] [--default=<default>] <name>"),
36+
N_("git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp=<regexp>] [--value=<pattern>] [--fixed-value] [--default=<default>] <name>"),
3737
NULL
3838
};
3939

4040
static const char *const builtin_config_set_usage[] = {
41-
N_("git config set [<file-option>] [--type=<type>] [--comment=<message>] [--all] [--value=<value>] [--fixed-value] <name> <value>"),
41+
N_("git config set [<file-option>] [--type=<type>] [--comment=<message>] [--all] [--value=<pattern>] [--fixed-value] <name> <value>"),
4242
NULL
4343
};
4444

4545
static const char *const builtin_config_unset_usage[] = {
46-
N_("git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>"),
46+
N_("git config unset [<file-option>] [--all] [--value=<pattern>] [--fixed-value] <name>"),
4747
NULL
4848
};
4949

0 commit comments

Comments
 (0)