From: Eric Sunshine <sunshine@sunshineco.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Lance Ward via GitGitGadget <gitgitgadget@gmail.com>,
Git List <git@vger.kernel.org>, Lance Ward <ljward10@gmail.com>
Subject: Re: [PATCH] status: fix verbose status coloring inconsistency
Date: Fri, 5 Feb 2021 02:17:04 -0500 [thread overview]
Message-ID: <CAPig+cRos+wGuwqbjuAV11kM5U0TPbBO9F4o4VJzQ4eZyxArMA@mail.gmail.com> (raw)
In-Reply-To: <xmqqa6skbw9u.fsf@gitster.c.googlers.com>
On Wed, Feb 3, 2021 at 5:51 PM Junio C Hamano <gitster@pobox.com> wrote:
> "Lance Ward via GitGitGadget" <gitgitgadget@gmail.com> writes:
> > t/t7527-status-color-pipe.sh | 55 ++++++++++++++++++++++++++++++++++++
>
> Don't we already have test that checks "status" output including its
> coloring already? I'd rather see us adding to existing test script,
> than allocating a new number for a small subset of features being
> tested for a command. After all, test numbers are limited resource.
t7508 seems like a good place for these tests.
> > +test_expect_success 'git status' '
> > + git status >raw &&
> > + test_decode_color <raw >out &&
> > + grep "original$" out
> > +'
>
> Not "new file: *original$" or something less false-positive prone?
The "new file:" message is localized, so this `grep` will need to
become `test_i18ngrep` again (as it was in the original submission) if
this approach is adopted, which is fine.
> > +test_expect_success 'git -c color.status=never status' '
> > + git -c color.status=never status >raw &&
> > + test_decode_color <raw >out &&
> > + grep "original$" out
> > +'
>
> Would it make sense to have tests for color.status=true, I wonder.
> It requires tty to actually "see" the colors output but sending
> the output to tty is the normal use case, so we should care...
I wondered if `color.status=true` might already be tested by t7508 but
apparently it only checks `auto`.
> > +test_expect_success 'git -c color.status=always status -v' '
> > + git -c color.status=always status -v >raw &&
> > + test_decode_color <raw >out &&
> > + grep "<CYAN>@@ -0,0 +1 @@<RESET>" out &&
> > + grep "GREEN>+<RESET><GREEN>1<RESET>" out
> > +'
>
> Are we forcing the standard palette?
As this is a stand-alone test script with a well-controlled initial
configuration, I expect it would be using the default palette. t7508
does assign a custom palette for `color.status` but not, apparently,
for `color.diff`, so it presumably should be okay there, as well.
prev parent reply other threads:[~2021-02-05 7:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 21:34 [PATCH] status: fix verbose status coloring inconsistency Lance Ward via GitGitGadget
2021-02-03 22:51 ` Junio C Hamano
2021-02-04 0:44 ` Lance Ward
2021-02-05 7:06 ` Eric Sunshine
2021-02-05 7:17 ` 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+cRos+wGuwqbjuAV11kM5U0TPbBO9F4o4VJzQ4eZyxArMA@mail.gmail.com \
--to=sunshine@sunshineco.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=ljward10@gmail.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).