diff options
author | Taylor Blau <me@ttaylorr.com> | 2018-04-10 03:18:31 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-23 16:52:20 +0300 |
commit | 63e2a0f8e9cc3d66137a72e424a8b59f1c4dbd79 (patch) | |
tree | dd5cb366414d546c755e41712980a0a829e14b5b /Documentation | |
parent | 6d2f9acc0f6c2df2b75ac69aee9077d7ea4eb2b5 (diff) |
builtin/config: introduce `color` type specifier
As of this commit, the canonical way to retreive an ANSI-compatible
color escape sequence from a configuration file is with the
`--get-color` action.
This is to allow Git to "fall back" on a default value for the color
should the given section not exist in the specified configuration(s).
With the addition of `--default`, this is no longer needed since:
$ git config --default red --type=color core.section
will be have exactly as:
$ git config --get-color core.section red
For consistency, let's introduce `--type=color` and encourage its use
with `--default` together over `--get-color` alone.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-config.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt index c3adafd78a..18ddc78f42 100644 --- a/Documentation/git-config.txt +++ b/Documentation/git-config.txt @@ -177,6 +177,10 @@ Valid `<type>`'s include: ~/` from the command line to let your shell do the expansion.) - 'expiry-date': canonicalize by converting from a fixed or relative date-string to a timestamp. This specifier has no effect when setting the value. +- 'color': When getting a value, canonicalize by converting to an ANSI color + escape sequence. When setting a value, a sanity-check is performed to ensure + that the given value is canonicalize-able as an ANSI color, but it is written + as-is. + --bool:: @@ -228,6 +232,8 @@ Valid `<type>`'s include: output it as the ANSI color escape sequence to the standard output. The optional `default` parameter is used instead, if there is no color configured for `name`. ++ +`--type=color [--default=<default>]` is preferred over `--get-color`. -e:: --edit:: |