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

[PATCH 0/5] config: support --type=bool-or-auto for "tristate" parsing

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 8, 2021, 13:34 UTC
Message-ID
<cover-0.6-0000000000-20210408T133125Z-avarab@gmail.com>

Refactor some of our internal C code to use a new git_config_tristate() functino instead of checking for "auto" or "bool" in several places.

This isn't just Yet Another Ævar Series, I'm using this to re-roll my outstanding userdiff series, the start of that topic was a partial refactor of userdiff.c which is better done here.

While writing this I discovered that the recently added --bool-or-type option added in https://lore.kernel.org/git/pull.781.v18.git.git.1599895268433.gitgitgadget@gmail.com/ didn't have any tests (and we didn't notice in 18! iterations of it:)

2/5 adds that, 1/5 adds a comment on some bool parsing code that's puzzled me for the Nth time.

Ævar Arnfjörð Bjarmason (5):
  config.c: add a comment about why value=NULL is true
  config tests: test for --bool-or-str
  git-config: document --bool-or-str and --type=bool-or-str
  config.c: add a "tristate" helper
  config: add --type=bool-or-auto switch
 Documentation/git-config.txt |   7 ++
 builtin/config.c             |  19 ++++++
 builtin/log.c                |  13 ++--
 compat/mingw.c               |   6 +-
 config.c                     |  20 ++++++
 config.h                     |  12 ++++
 http.c                       |   5 +-
 mergetools/meld              |   2 +-
 t/t1300-config.sh            | 121 +++++++++++++++++++++++++++++++++++
 userdiff.c                   |   6 +-
 10 files changed, 195 insertions(+), 16 deletions(-)
-- 
2.31.1.527.g9b8f7de2547
Next: Ævar Arnfjörð Bjarmason
Message 1 of 21 in “config: support --type=bool-or-auto for "tristate" parsing”
  1. 0/5 config: support --type=bool-or-auto for "tristate" parsingÆvar Arnfjörð Bjarmason, Apr 8, 2021
  2. 1/5 config.c: add a comment about why value=NULL is trueÆvar Arnfjörð Bjarmason, Apr 8, 2021
  3. Junio C HamanoApr 8, 2021
  4. 2/5 config tests: test for --bool-or-strÆvar Arnfjörð Bjarmason, Apr 8, 2021
  5. Junio C HamanoApr 8, 2021
  6. Ævar Arnfjörð BjarmasonApr 8, 2021
  7. 3/5 git-config: document --bool-or-str and --type=bool-or-strÆvar Arnfjörð Bjarmason, Apr 8, 2021
  8. Junio C HamanoApr 8, 2021
  9. 4/5 config.c: add a "tristate" helperÆvar Arnfjörð Bjarmason, Apr 8, 2021
  10. Junio C HamanoApr 8, 2021
  11. Ævar Arnfjörð BjarmasonApr 8, 2021
  12. Junio C HamanoApr 8, 2021
  13. Ævar Arnfjörð BjarmasonApr 9, 2021
  14. Junio C HamanoApr 9, 2021
  15. Junio C HamanoApr 8, 2021
  16. Jeff KingApr 9, 2021
  17. Junio C HamanoApr 9, 2021
  18. Jeff KingApr 10, 2021
  19. Junio C HamanoApr 10, 2021
  20. 5/5 config: add --type=bool-or-auto switchÆvar Arnfjörð Bjarmason, Apr 8, 2021
  21. Junio C HamanoApr 8, 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.