Thread (10 messages) 10 messages, 5 authors, 2021-06-29

Re: [PATCH] test-lib.sh: set COLUMNS=80 for --verbose repeatability

From: Jeff King <hidden>
Date: 2021-06-24 14:50:56

On Thu, Jun 24, 2021 at 12:19:31PM +0200, Ævar Arnfjörð Bjarmason wrote:
Some tests will fail under --verbose because while we've unset COLUMNS
since b1d645b58ac (tests: unset COLUMNS inherited from environment,
2012-03-27), we also look for the columns with an ioctl(..,
TIOCGWINSZ, ...) on some platforms. By setting COLUMNS again we
preempt the TIOCGWINSZ lookup in pager.c's term_columns(), it'll take
COLUMNS over TIOCGWINSZ,

This fixes the t0500-progress-display.sh test when run as:

    ./t0500-progress-display.sh --verbose

It broke because of a combination of the this issue and the progress
output reacting to the column width since 545dc345ebd (progress: break
too long progress bar lines, 2019-04-12). The
t5324-split-commit-graph.sh fails in a similar manner due to progress
output, see [1] for details.

A more narrow fix here would be to only do this in the --verbose mode,
but there's no harm in setting this for everything. If we're not
connected to a TTY the COLUMNS setting won't matter.
Thanks, this explanation and location make sense to me.

(minor s/the this/this/ in the third paragraph above).

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help