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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx [agc.klotz@xxxxxxxxx]

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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux