Re: [PATCH v6 2/8] config: add new way to pass config via `--config-env`
- From
Simon Ruderich <simon@ruderich.org>
- Date
- Jan 10, 2021, 20:29 UTC
- Message-ID
- <X/tjtVGRKRhX0ZvU@ruderich.org>
- In-Reply-To
- <9b8461010e641369316d00e2fc58c16e0e191f42.1610001187.git.ps@pks.im>
On Thu, Jan 07, 2021 at 07:36:52AM +0100, Patrick Steinhardt wrote:
Show 16 quoted lines
> [snip]
>
> +void git_config_push_env(const char *spec)
> +{
> + struct strbuf buf = STRBUF_INIT;
> + const char *env_name;
> + const char *env_value;
> +
> + env_name = strrchr(spec, '=');
> + if (!env_name)
> + die("invalid config format: %s", spec);
> + env_name++;
> +
> + env_value = getenv(env_name);
> + if (!env_value)
> + die("config variable missing for '%s'", env_name);I think "environment variable" should be mentioned in the error message to make it clear what kind of "variable" is missing.
Btw. shouldn't these strings get translated (or does die() do that automatically)?
Regards Simon
-- + privacy is necessary + using gnupg http://gnupg.org + public key id: 0x92FEFDB7E44C32F9