Re: [PATCH v2 02/13] config: add 'gently' parameter to format_config()
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Feb 17, 2026, 09:04 UTC
- Message-ID
- <aZQvOrNOjqiJSRC5@pks.im>
- In-Reply-To
- <93c94a1b257d26a23942e902630c220e4a4f8eaf.1771026918.git.gitgitgadget@gmail.com>
On Fri, Feb 13, 2026 at 11:55:07PM +0000, Derrick Stolee via GitGitGadget wrote:
Show 17 quoted lines
> 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