diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-04-05 17:49:49 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-04-05 17:49:49 (GMT) |
commit | 3256584c36f649abb2af58e7b190d3cf674ba56e (patch) | |
tree | 032547196dd3036dbbbe315621782dcf804d486e /Documentation | |
parent | 7774cfed6261ce2900c84e55906da708c711d601 (diff) | |
parent | 31399a6b6166cf76cc533bc9915878211607ed80 (diff) | |
download | git-3256584c36f649abb2af58e7b190d3cf674ba56e.zip git-3256584c36f649abb2af58e7b190d3cf674ba56e.tar.gz git-3256584c36f649abb2af58e7b190d3cf674ba56e.tar.bz2 |
Merge branch 'rs/config-comment'
"git config" learned "--comment=<message>" option to leave a
comment immediately after the "variable = value" on the same line
in the configuration file.
* rs/config-comment:
config: allow tweaking whitespace between value and comment
config: fix --comment formatting
config: add --comment option to add a comment
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-config.txt | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt index a6e82b8..ac61113 100644 --- a/Documentation/git-config.txt +++ b/Documentation/git-config.txt @@ -9,9 +9,9 @@ git-config - Get and set repository or global options SYNOPSIS -------- [verse] -'git config' [<file-option>] [--type=<type>] [--fixed-value] [--show-origin] [--show-scope] [-z|--null] <name> [<value> [<value-pattern>]] -'git config' [<file-option>] [--type=<type>] --add <name> <value> -'git config' [<file-option>] [--type=<type>] [--fixed-value] --replace-all <name> <value> [<value-pattern>] +'git config' [<file-option>] [--type=<type>] [--comment=<message>] [--fixed-value] [--show-origin] [--show-scope] [-z|--null] <name> [<value> [<value-pattern>]] +'git config' [<file-option>] [--type=<type>] [--comment=<message>] --add <name> <value> +'git config' [<file-option>] [--type=<type>] [--comment=<message>] [--fixed-value] --replace-all <name> <value> [<value-pattern>] '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>] @@ -87,6 +87,18 @@ OPTIONS values. This is the same as providing '^$' as the `value-pattern` in `--replace-all`. +--comment <message>:: + Append a comment at the end of new or modified lines. + + If _<message>_ begins with one or more whitespaces followed + by "#", it is used as-is. If it begins with "#", a space is + prepended before it is used. Otherwise, a string " # " (a + space followed by a hash followed by a space) is prepended + to it. And the resulting string is placed immediately after + the value defined for the variable. The _<message>_ must + not contain linefeed characters (no multi-line comments are + permitted). + --get:: Get the value for a given key (optionally filtered by a regex matching the value). Returns error code 1 if the key was not |