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

Re: [PATCH 1/3] t7006: add tests for how git config paginates

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 12, 2018, 22:17 UTC
Message-ID
<xmqq4lmlsvhr.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<450ff45707b58d6796d55cd594b50686e5d62fc2.1518365675.git.martin.agren@gmail.com>
Martin Ågren <martin.agren@gmail.com> writes:
Show 5 quoted lines
> +test_expect_success TTY 'git config respects pager.config when setting' '
> +	rm -f paginated.out &&
> +	test_terminal git -c pager.config config foo.bar bar &&
> +	test -e paginated.out
> +'

I am debating myself if this test should instead spell out what we eventually want from the above test and make it expect_failure, just like the next one.

In addition to setting (which will start ignoring pager in later steps), unsetting, replacing of a variable and renaming/removing a section in a configuration should not page, I would suspect. Should we test them all?

Show 32 quoted lines
> +test_expect_failure TTY 'git config --edit ignores pager.config' '
> +	rm -f paginated.out editor.used &&
> +	write_script editor <<-\EOF &&
> +		touch editor.used
> +	EOF
> +	EDITOR=./editor test_terminal git -c pager.config config --edit &&
> +	! test -e paginated.out &&
> +	test -e editor.used
> +'
> +
> +test_expect_success TTY 'git config --get defaults to not paging' '
> +	rm -f paginated.out &&
> +	test_terminal git config --get foo.bar &&
> +	! test -e paginated.out
> +'
> +
> +test_expect_success TTY 'git config --get respects pager.config' '
> +	rm -f paginated.out &&
> +	test_terminal git -c pager.config config --get foo.bar &&
> +	test -e paginated.out
> +'
> +
> +test_expect_success TTY 'git config --list defaults to not paging' '
> +	rm -f paginated.out &&
> +	test_terminal git config --list &&
> +	! test -e paginated.out
> +'
> +
> +
>  # A colored commit log will begin with an appropriate ANSI escape
>  # for the first color; the text "commit" comes later.
>  colorful() {
Previous: Martin ÅgrenNext: Martin Ågren
Message 6 of 12 in “t7006: add tests for how git config paginates”
  1. 1/3 t7006: add tests for how git config paginatesMartin Ågren, Feb 11, 2018
  2. 2/3 config: respect `pager.config` in list/get-mode onlyMartin Ågren, Feb 11, 2018
  3. Duy NguyenFeb 13, 2018
  4. Martin ÅgrenFeb 13, 2018
  5. 3/3 config: change default of `pager.config` to "on"Martin Ågren, Feb 11, 2018
  6. Junio C HamanoFeb 12, 2018
  7. Martin ÅgrenFeb 12, 2018
  8. 0/3 Re: t7006: add tests for how git config paginatesMartin Ågren, Feb 21, 2018
  9. 1/3 t7006: add tests for how git config paginatesMartin Ågren, Feb 21, 2018
  10. 2/3 config: respect `pager.config` in list/get-mode onlyMartin Ågren, Feb 21, 2018
  11. 3/3 config: change default of `pager.config` to "on"Martin Ågren, Feb 21, 2018
  12. Junio C HamanoFeb 21, 2018

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.