git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] test: skip test with COLUMNS=1 under mksh

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 27, 2012, 16:08 UTC
Message-ID
<xmqqehr99mz3.fsf@junio.mtv.corp.google.com>
In-Reply-To
<1335518725-19728-1-git-send-email-zbyszek@in.waw.pl>
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:
Show 11 quoted lines
> mksh does not allow $COLUMNS to be set below 12. Quoting mksh(1)
> $COLUMNS is "always set, defaults to 80, unless the value as reported
> by stty(1) is non-zero and sane enough". This applies also to setting
> it directly for one command:
>
> $ COLUMNS=30 python -c 'import os; print os.environ["COLUMNS"]'
> 30
> $ COLUMNS=20 python -c 'import os; print os.environ["COLUMNS"]'
> 20
> $ COLUMNS=10 python -c 'import os; print os.environ["COLUMNS"]'
> 98
I'd hate to say this, but that shell is broken.
> Let's test if we can set COLUMNS=1, and if not, skip the tests that
> want to use that. A prereq is added, which is set if $COLUMNS can be
> set.

And I think that is a sensible workaround, even though COLUMNS_CAN_BE_1 might not be the best name for it.

> +( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1

This is different from what you wrote in your log message, but I trust that it will fail under the problematic shell?

Will queue; thanks.
Previous: Zbigniew Jędrzejewski-SzmekNext: Zbigniew Jędrzejewski-Szmek
Message 9 of 17 in “t4052: test --stat output with --graph”
  1. 1/4 t4052: test --stat output with --graphLucian Poston, Apr 18, 2012
  2. 2/4 Adjust stat width calculations to take --graph output into accountLucian Poston, Apr 18, 2012
  3. 3/4 t4052: Test diff-stat output with minimum columnsLucian Poston, Apr 18, 2012
  4. Junio C HamanoApr 18, 2012
  5. Lucian PostonApr 18, 2012
  6. Lucian PostonApr 18, 2012
  7. Kacper KornetApr 26, 2012
  8. test: skip test with COLUMNS=1 under mkshZbigniew Jędrzejewski-Szmek, Apr 27, 2012
  9. Junio C HamanoApr 27, 2012
  10. Zbigniew Jędrzejewski-SzmekApr 28, 2012
  11. Junio C HamanoApr 27, 2012
  12. Stefano LattariniApr 27, 2012
  13. Zbigniew Jędrzejewski-SzmekApr 28, 2012
  14. Junio C HamanoApr 29, 2012
  15. 4/4 Prevent graph_width of stat width from falling below minLucian Poston, Apr 18, 2012
  16. Lucian PostonApr 18, 2012
  17. Zbigniew Jędrzejewski-SzmekApr 18, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.