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

Re: [PATCH v3 1/3] test-lib-functions: handle --add in test_config

From
Nipunn Koorapati <nipunn1313@gmail.com>
Date
Dec 22, 2020, 02:25 UTC
Message-ID
<CAN8Z4-WpNuqN=HxL4AQU_+zi4hGhkC18d3ZSOJGzbdkMPkYAMQ@mail.gmail.com>
In-Reply-To
<CAPig+cS4F5fhu-ej5ZVpzLR17AUhxzLRKVZxLuKaMCCk937C1A@mail.gmail.com>
Show 15 quoted lines
> Yes, you could do that, though it is somewhat subtle and increases
> cognitive load since the reader has to reason about it a bit more --
> and perhaps study the internal implementation of test_config() -- to
> convince himself or herself that the different methods of setting
> configuration (test_config() vs. `git config`) used in the same test
> is intentional and works as intended.
>
> The example presented earlier, on the other hand, in which cleanup is
> explicit via `test_when_finished "test_unconfig ..."` does not suffer
> from such increased cognitive load since it uses `git config`
> consistently to set configuration rather than a mix of `git config`
> and test_config(). This sort of consideration is important not just
> for reviewers, but for people who need to understand the code down the
> road. For this reason, I think I favor the version in which the
> cleanup is explicit. (But that's just my opinion...)

Totally sympathize with wanting to reduce the cognitive load of reading the test suite. As a reader of the test, I found both implementation choices nonobvious - and requiring some diving into test_config and test_unconfig (namely the --unset-all behavior). A comment on the `git config` stating that it's there because `test_config` doesn't yet support `--add` seems equally clarifying as inserting a comment next to the test_unconfig usage. That being said, I suspect anyone in the future poking around with this will have to sourcedive through test_config and test_unconfig to make sense of it.

I'll switch it over to the test_unconfig option on the next reroll if requested.
--Nipunn
Previous: Eric SunshineNext: Eric Sunshine
Message 18 of 33 in “negative-refspec: fix segfault on : refspec”
  1. negative-refspec: fix segfault on : refspecNipunn Koorapati via GitGitGadget, Dec 19, 2020
  2. Junio C HamanoDec 19, 2020
  3. Jacob KellerFeb 19, 2021
  4. 0/2 negative-refspec: fix segfault on : refspecNipunn Koorapati via GitGitGadget, Dec 19, 2020
  5. 1/2 negative-refspec: fix segfault on : refspecNipunn Koorapati via GitGitGadget, Dec 19, 2020
  6. Eric SunshineDec 20, 2020
  7. 2/2 negative-refspec: improve comment on query_matches_negative_refspecNipunn Koorapati via GitGitGadget, Dec 19, 2020
  8. 0/3 negative-refspec: fix segfault on : refspecNipunn Koorapati via GitGitGadget, Dec 21, 2020
  9. 3/3 negative-refspec: improve comment on query_matches_negative_refspecNipunn Koorapati via GitGitGadget, Dec 21, 2020
  10. 2/3 negative-refspec: fix segfault on : refspecNipunn Koorapati via GitGitGadget, Dec 21, 2020
  11. Eric SunshineDec 21, 2020
  12. 1/3 test-lib-functions: handle --add in test_configNipunn Koorapati via GitGitGadget, Dec 21, 2020
  13. Eric SunshineDec 21, 2020
  14. Junio C HamanoDec 21, 2020
  15. Eric SunshineDec 21, 2020
  16. Nipunn KoorapatiDec 22, 2020
  17. Eric SunshineDec 22, 2020
  18. Nipunn KoorapatiDec 22, 2020
  19. Eric SunshineDec 22, 2020
  20. 0/2 negative-refspec: fix segfault on : refspecNipunn Koorapati via GitGitGadget, Dec 22, 2020
  21. 2/2 negative-refspec: improve comment on query_matches_negative_refspecNipunn Koorapati via GitGitGadget, Dec 22, 2020
  22. 1/2 negative-refspec: fix segfault on : refspecNipunn Koorapati via GitGitGadget, Dec 22, 2020
  23. Junio C HamanoDec 22, 2020
  24. Junio C HamanoDec 22, 2020
  25. 0/2 negative-refspec: fix segfault on : refspecNipunn Koorapati via GitGitGadget, Dec 22, 2020
  26. 2/2 negative-refspec: improve comment on query_matches_negative_refspecNipunn Koorapati via GitGitGadget, Dec 22, 2020
  27. 1/2 negative-refspec: fix segfault on : refspecNipunn Koorapati via GitGitGadget, Dec 22, 2020
  28. Jacob KellerFeb 19, 2021
  29. Junio C HamanoDec 22, 2020
  30. Nipunn KoorapatiDec 23, 2020
  31. Junio C HamanoDec 24, 2020
  32. Nipunn KoorapatiJan 11, 2021
  33. Junio C HamanoJan 12, 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.