From: Firmin Martin Date: Mon, 17 May 2021 07:44:22 GMT Subject: Re: [PATCH v2 1/2] t/README: document test_config Message-ID: <87cztpg5yh.fsf@Inspiron.i-did-not-set--mail-host-address--so-tickle-me> In-Reply-To: <5faaa5a6-8ebf-b2ef-805f-551a36ab7e6c@gmail.com> Hi Bagas, Bagas Sanjaya writes: > On 15/05/21 22.27, Firmin Martin wrote: >> >> + - test_config [] >> + >> + Set the configuration option to , 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_* >> + must not be used in a subshell. >> + > From the syntax above, when I omit , default value for > will be set, right? Good remark. I thought the same as you, but no, it will "git config " (query the value of ) and then "git config --unset " which is dangerous. Doing so is more likely an error and should be forbidden, as in this case, it is equivalent to test_unconfig . Will reflect this in v3. > You forgot to mention it. I'll thus drop square brackets. >> + 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 >> + >> > > The description said "set the config, then unset it". But the expanded version > said "unsetting the config is deferred to the end of test and set the config". > > The documentation for test_when_finished said: > >> Prepend