Re: [PATCH v2 1/2] t/README: document test_config
- From
Bagas Sanjaya <bagasdotme@gmail.com>
- Date
- May 16, 2021, 05:03 UTC
- Message-ID
- <5faaa5a6-8ebf-b2ef-805f-551a36ab7e6c@gmail.com>
- In-Reply-To
- <20210515152721.885728-2-firminmartin24@gmail.com>
On 15/05/21 22.27, Firmin Martin wrote:
Show 8 quoted lines
> > + - 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_* > + must not be used in a subshell. > +
From the syntax above, when I omit <value>, default value for <config-option> will be set, right? You forgot to mention it.
Show 9 quoted lines
> + 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 <script> to a list of commands to run to clean up > at the end of the current test. If some clean-up command > fails, the test will not pass.
Is my interpretation above correct?
Oh yeah, maybe it's better to say: "For example: <blah> have the same effect as <blah>."
Thanks.
-- An old man doll... just what I always wanted! - Clara