git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 1/2] t/README: document test_config
@ 2021-05-14  6:55 Firmin Martin
  2021-05-14  6:55 ` [PATCH 2/2] t: use test_config whenever possible Firmin Martin
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Firmin Martin @ 2021-05-14  6:55 UTC (permalink / raw)
  To: Firmin Martin, git; +Cc: Junio C Hamano

test_config is used over one thousand times in the test suite, yet not
documented. Give it a place in the "Test harness library" section.

Signed-off-by: Firmin Martin <firminmartin24@gmail.com>
---
 t/README | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/t/README b/t/README
index 8eb9e46b1d..f69aa05c61 100644
--- a/t/README
+++ b/t/README
@@ -1046,6 +1046,21 @@ library for your script to use.
    Abort the test script if either the value of the variable or the
    default are not valid bool values.
 
+ - test_config <config-option> [<value>]
+
+   Set the configuration option <config-option> to <value>, and unset it at the
+   end of the current test. For a similar purpose, test_config_global for
+   global configuration is also available. Note, however, that test_config_*
+   should not be used under a subshell.
+  
+   Example:
+
+	test_config format.coverLetter auto
+
+   Is a concise way to write:
+	test_when_finished "git config --unset format.coverLetter" &&
+	git config format.coverLetter auto
+
 
 Prerequisites
 -------------
-- 
2.31.1.443.g67a420f573


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-05-17  7:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14  6:55 [PATCH 1/2] t/README: document test_config Firmin Martin
2021-05-14  6:55 ` [PATCH 2/2] t: use test_config whenever possible Firmin Martin
2021-05-15 20:15   ` Felipe Contreras
2021-05-15 20:21     ` Felipe Contreras
2021-05-15 22:00       ` Firmin Martin
2021-05-14  7:02 ` [PATCH 1/2] t/README: document test_config Eric Sunshine
2021-05-15 14:43   ` Firmin Martin
2021-05-15 15:27 ` [PATCH v2 0/2] document test_config & use it whenever possible Firmin Martin
2021-05-15 15:27   ` [PATCH v2 1/2] t/README: document test_config Firmin Martin
2021-05-16  5:03     ` Bagas Sanjaya
2021-05-17  7:44       ` Firmin Martin
2021-05-15 15:27   ` [PATCH v2 2/2] t: use test_config whenever possible Firmin Martin
2021-05-16  5:02     ` Junio C Hamano
2021-05-17  6:08       ` Firmin Martin
2021-05-17  6:55         ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).