From: Patrick Steinhardt Date: Fri, 11 Sep 2026 07:34:17 GMT Subject: Re: [PATCH v4 1/3] config: add git_config_append_parameter() Message-ID: In-Reply-To: <0472fadbc564fb724e2cb14f306c1c29ed42ef40.1788942331.git.gitgitgadget@gmail.com> On Wed, Sep 09, 2026 at 08:25:29AM +0000, Thomas Bachem via GitGitGadget wrote: > From: Thomas Bachem > > "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. > 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 "''=''" pairs. Patrick