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

Re: [PATCH v2 3/3] tests: defang pager tests by explicitly disabling the log.mailmap warning

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 14, 2019, 21:56 UTC
Message-ID
<xmqqy31046w1.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190712230204.16749-4-ariadne@dereferenced.org>
Ariadne Conill <ariadne@dereferenced.org> writes:
Show 9 quoted lines
> In the previous patch, we added a deprecation warning for the current
> log.mailmap setting. This warning only appears when git is attached to
> a controlling terminal. Some tests however run under an emulated
> terminal, so we need to disable the warning for those tests.
>
> Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
> ---
>  t/t7006-pager.sh | 10 ++++++++++
>  1 file changed, 10 insertions(+)
Hmm, this is horrible.  

These tests are primarily to see how use of color gets affected by various configuration and the use of the pager, and having to sprinkle log.mailmap configuration to just randomly selected 10 tests among 50+ tests in the script makes readers wonder if the configuration has anything to do with the coloring (answer: no).

The primary reason why other 40+ tests do not need log.mailmap tweaked is not because log.mailmap does not affect the coloring. But for a new developer who will be adding a new test to this file, how would s/he decide if the new test needs log.mailmap=false like these 10, or it is like the other 40+?

It almost makes me feel that it would be much better to just disable the warning inside the setup part, perhaps like

diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 00e09a375c..283de499fc 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -7,6 +7,8 @@ test_description='Test automatic use of a pager.'
 . "$TEST_DIRECTORY"/lib-terminal.sh
 
 test_expect_success 'setup' '
+	: squelch advise messages during the transition &&
+	git config --global log.mailmap false &&
 	sane_unset GIT_PAGER GIT_PAGER_IN_USE &&
 	test_unconfig core.pager &&
 
Previous: Ariadne Conill
Message 6 of 6 in “document deprecation of log.mailmap=false default”
  1. 0/3 document deprecation of log.mailmap=false defaultAriadne Conill, Jul 12, 2019
  2. 1/3 log: add warning for unspecified log.mailmap settingAriadne Conill, Jul 12, 2019
  3. Junio C HamanoJul 14, 2019
  4. 2/3 documentation: mention --no-use-mailmap and log.mailmap false settingAriadne Conill, Jul 12, 2019
  5. 3/3 tests: defang pager tests by explicitly disabling the log.mailmap warningAriadne Conill, Jul 12, 2019
  6. Junio C HamanoJul 14, 2019

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.