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

[PATCH v3 0/3] test-lib.sh: use GIT_TEST_COLUMNS over COLUMNS

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Aug 4, 2021, 23:05 UTC
Message-ID
<cover-v3-0.3-00000000000-20210804T230335Z-avarab@gmail.com>
In-Reply-To
<cover-v2-0.3-00000000000-20210802T134610Z-avarab@gmail.com>

This v3 addresses SZEDER's note in <20210802171429.GC23408@szeder.dev> that we were missing redirection. The "is_git_command_name" check has also been moved one commit earlier, as it should.

Ævar Arnfjörð Bjarmason (3):
  test-lib-functions.sh: rename test_must_fail_acceptable()
  test-lib-functions.sh: add a test_with_columns function
  test-lib.sh: use GIT_TEST_COLUMNS over COLUMNS
 pager.c                       |  7 +++++++
 t/t3200-branch.sh             |  8 ++++----
 t/t4052-stat-output.sh        | 22 +++++++++++-----------
 t/t4205-log-pretty-formats.sh |  6 +++---
 t/t7004-tag.sh                |  6 +++---
 t/t7006-pager.sh              |  2 +-
 t/t7508-status.sh             |  4 ++--
 t/t9002-column.sh             | 23 ++++++++++-------------
 t/test-lib-functions.sh       | 21 ++++++++++++++++++---
 t/test-lib.sh                 | 13 +++++++++++--
 10 files changed, 70 insertions(+), 42 deletions(-)
Range-diff against v2:
1:  739457b992f = 1:  f45590a76d5 test-lib-functions.sh: rename test_must_fail_acceptable()
2:  36c57178c55 ! 2:  53e6e25ece6 test-lib-functions.sh: add a test_with_columns function
    @@ t/test-lib-functions.sh: test_region () {
     +	local columns=$1
     +	shift
     +
    -+	COLUMNS=$columns "$@"
    -+}
    ++	if ! is_git_command_name "$@"
    ++	then
    ++		echo >&7 "test_with_columns: only 'git' is allowed: $*"
    ++		return 1
    ++	fi
    ++
    ++	COLUMNS=$columns "$@" 2>&7
    ++} 7>&2 2>&4
3:  6cbbb955e9a ! 3:  74acba0f9ca test-lib.sh: use GIT_TEST_COLUMNS over COLUMNS
    @@ pager.c: int term_columns(void)
     
      ## t/test-lib-functions.sh ##
     @@ t/test-lib-functions.sh: test_with_columns () {
    - 	local columns=$1
    - 	shift
    + 		return 1
    + 	fi
      
    -+	if ! is_git_command_name "$@"
    -+	then
    -+		echo >&7 "test_with_columns: only 'git' is allowed: $*"
    -+		return 1
    -+	fi
    -+
     +	GIT_TEST_COLUMNS= \
    - 	COLUMNS=$columns "$@"
    - }
    + 	COLUMNS=$columns "$@" 2>&7
    + } 7>&2 2>&4
     
      ## t/test-lib.sh ##
     @@ t/test-lib.sh: LANG=C
-- 
2.33.0.rc0.597.gc569a812f0a
Previous: Eric SunshineNext: Ævar Arnfjörð Bjarmason
Message 23 of 26 in “progress test failure on fedora34”
  1. Fabian StelzerJul 14, 2021
  2. Ævar Arnfjörð BjarmasonJul 14, 2021
  3. Alex HenrieJul 14, 2021
  4. Ævar Arnfjörð BjarmasonJul 18, 2021
  5. Jeff KingJul 19, 2021
  6. Alex HenrieJul 19, 2021
  7. Alex HenrieJul 19, 2021
  8. Felipe ContrerasJul 19, 2021
  9. Felipe ContrerasJul 19, 2021
  10. Alex HenrieJul 19, 2021
  11. Felipe ContrerasJul 20, 2021
  12. ZheNing HuJul 21, 2021
  13. Felipe ContrerasJul 21, 2021
  14. test-lib.sh: use GIT_TEST_COLUMNS over COLUMNSÆvar Arnfjörð Bjarmason, Jul 26, 2021
  15. Jeff KingJul 27, 2021
  16. Junio C HamanoJul 28, 2021
  17. 0/3 test-lib.sh: use GIT_TEST_COLUMNS over COLUMNSÆvar Arnfjörð Bjarmason, Aug 2, 2021
  18. 1/3 test-lib-functions.sh: rename test_must_fail_acceptable()Ævar Arnfjörð Bjarmason, Aug 2, 2021
  19. 3/3 test-lib.sh: use GIT_TEST_COLUMNS over COLUMNSÆvar Arnfjörð Bjarmason, Aug 2, 2021
  20. 2/3 test-lib-functions.sh: add a test_with_columns functionÆvar Arnfjörð Bjarmason, Aug 2, 2021
  21. SZEDER GáborAug 2, 2021
  22. Eric SunshineAug 2, 2021
  23. 0/3 test-lib.sh: use GIT_TEST_COLUMNS over COLUMNSÆvar Arnfjörð Bjarmason, Aug 4, 2021
  24. 1/3 test-lib-functions.sh: rename test_must_fail_acceptable()Ævar Arnfjörð Bjarmason, Aug 4, 2021
  25. 3/3 test-lib.sh: use GIT_TEST_COLUMNS over COLUMNSÆvar Arnfjörð Bjarmason, Aug 4, 2021
  26. 2/3 test-lib-functions.sh: add a test_with_columns functionÆvar Arnfjörð Bjarmason, Aug 4, 2021

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.