Subject: Re: [PATCH v2 06/13] config: format bools or ints gently

From: Patrick Steinhardt <[email-masked]>
Date: Tue, 17 Feb 2026 10:05:08 +0100

On Fri, Feb 13, 2026 at 11:55:11PM +0000, Derrick Stolee via GitGitGadget wrote:
> diff --git a/builtin/config.c b/builtin/config.c
> index 2c169fc126..2c93e1725b 100644
> --- a/builtin/config.c
> +++ b/builtin/config.c
> @@ -274,6 +274,34 @@ static int format_config_bool(struct strbuf *buf,
>  	return 0;
>  }
>  
> +static int format_config_bool_or_int(struct strbuf *buf,
> +				     const char *key_,
> +				     const char *value_,
> +				     const struct key_value_info *kvi,
> +				     int gently)
> +{
> +	int v, is_bool = 0;
> +
> +	if (gently) {
> +		v = git_parse_maybe_bool_text(value_);

This function also returns `1` in case `!value`. Is this intended? I
guess so due to our implicit bool thingy, and `git_config_bool_or_int()`
seems to behave the same.

Patrick