Re: [PATCH v4 1/3] config: add git_config_append_parameter()
On Wed, Sep 09, 2026 at 08:25:29AM +0000, Thomas Bachem via GitGitGadget wrote:
Show 11 quoted lines
> From: Thomas Bachem <mail@thomasbachem.com>
>
> "git -c" passes its settings to the commands it spawns through
> GIT_CONFIG_PARAMETERS, a list of quoted 'key'='value' pairs. The only
> place that formats such an entry is git_config_push_split_parameter(),
> which writes straight into our own environment.
>
> Split the formatting out into git_config_append_parameter(), which
> appends one entry to a strbuf, so that a caller can build the value
> for a child's environment. The sequencer will use it in a later
> commit.
Thanks, this commit message is much better now.
Show 18 quoted lines
> diff --git a/config.h b/config.h
> index b66dd08007..838d1509a9 100644
> --- a/config.h
> +++ b/config.h
> @@ -186,6 +187,18 @@ int git_config_from_blob_oid(config_fn_t fn, const char *name,
> enum config_scope scope);
> void git_config_push_parameter(const char *text);
> void git_config_push_env(const char *spec);
> +
> +/*
> + * Append a "-c key=value" setting to a GIT_CONFIG_PARAMETERS value in
> + * `env`. The variable carries such settings from a git process to the
> + * git commands it spawns, as a space separated list of 'key'='value'
> + * pairs with both sides single quoted, which git_config_from_parameters()
> + * reads back. A NULL `value` appends 'key'= with nothing after the equals
> + * sign, which stands for a boolean true, like "-c key" on the command
> + * line.
> + */
Nit: this is not necessarily specific to "-c key=value", and your later
patches in fact add sites where that is not the source. Proposal:
Append a config option to the buffer that can be exported via the
GIT_CONFIG_PARAMETERS environment variable, which allows us to
propagate configuration across Git processes. The format of the
variable is a space-separated list of quoted "'<key>'='<value>'"
pairs.
Patrick