Re: [PATCH] chainlint: colorize problem annotations and test delimiters
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 12, 2022, 23:55 UTC
- Message-ID
- <xmqqsfkwb12i.fsf@gitster.g>
- In-Reply-To
- <pull.1324.git.git.1663023888412.gitgitgadget@gmail.com>
"Eric Sunshine via GitGitGadget" <gitgitgadget@gmail.com> writes:
> + $checked =~ s/(\?![^?]+\?!)/$c->{bold}$c->{red}$1$c->{reset}/mg;It may be just me, but coloring the whole "?!LOOP?!" in red feels a bit strange. I would have expected more like
if ($c->{color_in_use}) {
$checked =~ s/\?!([^?]+)\?!/$c->{bold}$c->{red}$1$c->{reset}/mg;
}IOW, switching between "?!LOOP?!" and "<BOLD><RED>LOOP<RESET>".
But it may be just me.
> +# Restore TERM if test framework set it to "dumb" so 'tput' will work; do this
> +# outside of get_colors() since under 'ithreads' all threads use %ENV of main
> +# thread and ignore %ENV changes in subthreads.
> +$ENV{TERM} = $ENV{USER_TERM} if $ENV{USER_TERM};Sounds quite sensible.