From: Junio C Hamano <gitster@pobox.com>
To: Kevin Ballard <kevin@sb.org>
Cc: git@vger.kernel.org, Nazri Ramliy <ayiehere@gmail.com>
Subject: Re: [PATCH v2 1/2] test-lib: extend test_decode_color to handle more color codes
Date: Wed, 20 Oct 2010 16:40:30 -0700 [thread overview]
Message-ID: <7v39s0v3f5.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1287613046-61804-1-git-send-email-kevin@sb.org> (Kevin Ballard's message of "Wed\, 20 Oct 2010 15\:17\:25 -0700")
Kevin Ballard <kevin@sb.org> writes:
> Enhance the test_decode_color function to handle all common color codes,
> including background colors and escapes that contain multiple codes.
> This change necessitates changing <WHITE> to <BOLD>, so update t4034
> as well.
>
> This change is necessary for the next commit in order to test
> background colors properly.
>
> Signed-off-by: Kevin Ballard <kevin@sb.org>
> ---
> I turned sed into awk. Looks like awk is already used elsehwere in git,
> so I'm assuming this is safe, but please let me know if it's not.
I think calling BOLD BOLD is the right thing to do (who came up with the
bogus WHITE in the first place anyway---my terminal is black letters on
white background, thank you).
Even though some scripts seem to already use awk, they are all used for
very small and trivial processing without exercising anything remotely
fancy e.g. hexadecimal \xXX quoting or match() function, so I wouldn't be
surprised if we see breakage reports from minority platforms.
But I do not think of a trivial way to express combination of attributes
by extending the existing sed script (we can write loops and do the same
computation as your awk script does, but it does not reduce the complexity
nor risk of portability issues), so let's see what happens. We already
use Perl everywhere, which we might end up using for this if there are
platforms that have issues with your awk script.
Thanks.
next prev parent reply other threads:[~2010-10-20 23:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-20 4:46 [PATCH] diff: handle lines containing only whitespace better Kevin Ballard
2010-10-20 6:16 ` Junio C Hamano
2010-10-20 6:38 ` Kevin Ballard
2010-10-20 7:51 ` Nazri Ramliy
2010-10-20 16:08 ` Junio C Hamano
2010-10-20 22:17 ` [PATCH v2 1/2] test-lib: extend test_decode_color to handle more color codes Kevin Ballard
2010-10-20 23:40 ` Junio C Hamano [this message]
2010-10-21 0:11 ` Kevin Ballard
2010-10-20 22:17 ` [PATCH v2 2/2] diff: handle lines containing only whitespace and tabs better Kevin Ballard
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=7v39s0v3f5.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=ayiehere@gmail.com \
--cc=git@vger.kernel.org \
--cc=kevin@sb.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.