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

[PATCH 0/2] config: improve error message for boolean config

From
Andrew Klotz via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 18, 2020, 02:17 UTC
Message-ID
<pull.841.git.git.1600395427.gitgitgadget@gmail.com>

Currently invalid boolean config values return messages about 'bad numeric', which I found misleading when the error was due to a boolean string value. This change makes the error message reflect the boolean value.

The current approach relies on GIT_TEST_GETTEXT_POISON being a boolean value, moving its special case out fromdie_bad_number() and into git_config_bool_or_int(). An alternative could be for die_bad_number() to handle boolean values when erroring, although the function name might need to change if it is handling non-numeric values.

Signed-off-by: Andrew Klotz agc.klotz@gmail.com [agc.klotz@gmail.com]
Andrew Klotz (2):
  config: improve error message for boolean config
  formatting for error messages
 config.c                  | 26 ++++++++++++++------------
 t/t0205-gettext-poison.sh |  2 +-
 2 files changed, 15 insertions(+), 13 deletions(-)
base-commit: 3a238e539bcdfe3f9eb5010fd218640c1b499f7a
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-841%2FKlotzAndrew%2Fbetter_bool_errors-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-841/KlotzAndrew/better_bool_errors-v1
Pull-Request: https://github.com/git/git/pull/841
-- 
gitgitgadget
Next: Andrew Klotz via GitGitGadget
Message 1 of 13 in “config: improve error message for boolean config”
  1. 0/2 config: improve error message for boolean configAndrew Klotz via GitGitGadget, Sep 18, 2020
  2. 1/2 config: improve error message for boolean configAndrew Klotz via GitGitGadget, Sep 18, 2020
  3. Jeff KingSep 18, 2020
  4. Phillip WoodSep 18, 2020
  5. Junio C HamanoSep 18, 2020
  6. 2/2 formatting for error messagesAndrew Klotz via GitGitGadget, Sep 18, 2020
  7. Junio C HamanoSep 18, 2020
  8. config: improve error message for boolean configAndrew Klotz via GitGitGadget, Feb 9, 2021
  9. Jeff KingFeb 9, 2021
  10. Junio C HamanoFeb 9, 2021
  11. config: improve error message for boolean configAndrew Klotz via GitGitGadget, Feb 11, 2021
  12. Jeff KingFeb 12, 2021
  13. Junio C HamanoFeb 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.