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

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

From
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Date
Apr 28, 2012, 11:09 UTC
Message-ID
<4F9BCFD9.8020005@in.waw.pl>
In-Reply-To
<4F9B1F38.8040406@gmail.com>
On 04/28/2012 12:35 AM, Stefano Lattarini wrote:
Show 36 quoted lines
> Hi Junio, Zbigniew.
> 
> On 04/27/2012 06:21 PM, Junio C Hamano wrote:
>> Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:
>>
>>> 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 wonder if this is an easier workaround, though.
>>
>> 	env COLUMNS=10 $cmd
>>
> It works for me:
> 
>   $ mksh -c 'COLUMNS=10 env | grep COLUMNS'
>   COLUMNS=113
> 
>   $ mksh -c 'env COLUMNS=10 env | grep COLUMNS'
>   COLUMNS=10
> 
>   $ dpkg -l mksh
>   ...
>   ii  mksh  40.2-2  MirBSD Korn Shell
> 
> HTH,
>   Stefano
> 

This approach with 'env COLUMNS=1 git ...' looks nicer, and works when invoked directly, but doesn't work when run under the test harness, because bin-wrappers/git uses !/bin/sh, which resets COLUMNS. So this simpler approach doesn't look feasible.

Zbyszek
Previous: Stefano LattariniNext: Junio C Hamano
Message 13 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.