From: Eric Sunshine <sunshine@sunshineco.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: Git List <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v2 5/5] builtin/config: introduce `color` type specifier
Date: Fri, 27 Apr 2018 02:22:23 -0400 [thread overview]
Message-ID: <CAPig+cQx3RKCyAisVdEiwLpVPEhPRVWJ2rdA8yawZFq1891mwg@mail.gmail.com> (raw)
In-Reply-To: <d9a737fde37e778c637de67e1215960f467c629d.1524722247.git.me@ttaylorr.com>
On Thu, Apr 26, 2018 at 1:58 AM, Taylor Blau <me@ttaylorr.com> wrote:
> [...]
> 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>
> ---
> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
> @@ -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`.
Rather than augmenting the documentation of --get-color like this, I
wonder if it would instead make more sense to replace it entirely,
like this:
--get-color name [<default>]
Deprecated alias for `--type=color [--default=<default>]`.
Not necessarily worth a re-roll; could be done as a follow-up if
someone cares enough.
> diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
> @@ -931,6 +931,36 @@ test_expect_success 'get --expiry-date' '
> +test_expect_success 'get --type=color' '
> + rm .git/config &&
I would feel more confident about the robustness of this test if it
instead used 'rm -f .git/config', as is already done elsewhere in this
test script.
> + git config foo.color "red" &&
> + git config --get --type=color foo.color >actual.raw &&
> + test_decode_color <actual.raw >actual &&
> + echo "<RED>" >expect &&
> + test_cmp expect actual
> +'
> +
> +test_expect_success 'set --type=color' '
> + rm .git/config &&
Ditto.
> + git config --type=color foo.color "red" &&
> + test_cmp expect .git/config
> +'
prev parent reply other threads:[~2018-04-27 6:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-26 4:25 [PATCH 0/5] builtin/config.c: combined series '--type', '--default' Taylor Blau
2018-04-26 4:25 ` [PATCH 1/5] builtin/config.c: treat type specifiers singularly Taylor Blau
2018-04-26 4:25 ` [PATCH 2/5] builtin/config.c: support `--type=<type>` as preferred alias for `--type` Taylor Blau
2018-04-26 5:25 ` Junio C Hamano
2018-04-26 6:00 ` Taylor Blau
2018-04-27 6:06 ` Eric Sunshine
2018-04-26 4:25 ` [PATCH 3/5] builtin/config: introduce `--default` Taylor Blau
2018-04-26 4:25 ` [PATCH 4/5] config.c: introduce 'git_config_color' to parse ANSI colors Taylor Blau
2018-04-26 4:25 ` [PATCH 5/5] builtin/config: introduce `color` type specifier Taylor Blau
2018-04-26 5:32 ` Junio C Hamano
2018-04-26 6:01 ` Taylor Blau
2018-04-26 5:58 ` [PATCH v2 0/5] builtin/config.c: combined series '--type', '--default' Taylor Blau
2018-04-26 5:58 ` [PATCH v2 1/5] builtin/config.c: treat type specifiers singularly Taylor Blau
2018-04-26 5:58 ` [PATCH v2 2/5] builtin/config.c: support `--type=<type>` as preferred alias for `--<type>` Taylor Blau
2018-04-26 9:49 ` Junio C Hamano
2018-04-27 5:57 ` Eric Sunshine
2018-04-26 5:58 ` [PATCH v2 3/5] builtin/config: introduce `--default` Taylor Blau
2018-04-26 5:58 ` [PATCH v2 4/5] config.c: introduce 'git_config_color' to parse ANSI colors Taylor Blau
2018-04-26 5:58 ` [PATCH v2 5/5] builtin/config: introduce `color` type specifier Taylor Blau
2018-04-27 6:22 ` Eric Sunshine [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPig+cQx3RKCyAisVdEiwLpVPEhPRVWJ2rdA8yawZFq1891mwg@mail.gmail.com \
--to=sunshine@sunshineco.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@ttaylorr.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).