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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ariadne Conill <ariadne@xxxxxxxxxxxxxxxx> writes:

> 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@xxxxxxxxxxxxxxxx>
> ---
>  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 &&
 



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux