Subject: Re: [PATCH v2 02/13] config: add 'gently' parameter to format_config()

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

On Fri, Feb 13, 2026 at 11:55:07PM +0000, Derrick Stolee via GitGitGadget wrote:
> diff --git a/builtin/config.c b/builtin/config.c
> index 237f7a934d..b4c4228311 100644
> --- a/builtin/config.c
> +++ b/builtin/config.c
> @@ -242,10 +242,14 @@ struct strbuf_list {
>   * append it into strbuf `buf`.  Returns a negative value on failure,
>   * 0 on success, 1 on a missing optional value (i.e., telling the
>   * caller to pretend that <key_,value_> did not exist).
> + *
> + * Note: 'gently' is currently ignored, but will be implemented in
> + * a future change.
>   */
>  static int format_config(const struct config_display_options *opts,
>  			 struct strbuf *buf, const char *key_,
> -			 const char *value_, const struct key_value_info *kvi)
> +			 const char *value_, const struct key_value_info *kvi,
> +			 int gently UNUSED)

I'd propose to either make this a bool, or turn it into an enum flag so
that it becomes easier to see at the callsite what the magic "true" or
"1" means:

    enum format_config_flags {
        /*
         * Do not die in case the value cannot be parsed properly, but
         * return an error instead.
         */
        FORMAT_CONFIG_GENTLY = (1 << 0),
    };

    format_config(opts, buf, key, value, kv, FORMAT_CONFIG_GENTLY);

I personally prefer this option over using a bool, even though it's a
bit more verbose.

Patrick