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

[PATCH 1/2] t/README: document test_config

From
Firmin Martin <firminmartin24@gmail.com>
Date
May 14, 2021, 06:55 UTC
Message-ID
<20210514065508.247044-1-firminmartin24@gmail.com>

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
Next: Firmin Martin
Message 1 of 15 in “t/README: document test_config”
  1. 1/2 t/README: document test_configFirmin Martin, May 14, 2021
  2. 2/2 t: use test_config whenever possibleFirmin Martin, May 14, 2021
  3. Felipe ContrerasMay 15, 2021
  4. Felipe ContrerasMay 15, 2021
  5. Firmin MartinMay 15, 2021
  6. Eric SunshineMay 14, 2021
  7. Firmin MartinMay 15, 2021
  8. 0/2 document test_config & use it whenever possibleFirmin Martin, May 15, 2021
  9. 1/2 t/README: document test_configFirmin Martin, May 15, 2021
  10. Bagas SanjayaMay 16, 2021
  11. Firmin MartinMay 17, 2021
  12. 2/2 t: use test_config whenever possibleFirmin Martin, May 15, 2021
  13. Junio C HamanoMay 16, 2021
  14. Firmin MartinMay 17, 2021
  15. Junio C HamanoMay 17, 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.