Re: [PATCH v2 1/2] test-lib: extend test_decode_color to handle more color codes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kevin Ballard <kevin@xxxxxx> 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@xxxxxx>
> ---
> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]