Re: [PATCH] gpg-interface: allow selecting key id with env variable
- From
Fabian Stelzer <fs@gigacodes.de>
- Date
- Oct 25, 2021, 08:46 UTC
- Message-ID
- <bc6b915a-7aa0-298b-e1ec-bf548e4dbdfc@gigacodes.de>
- In-Reply-To
- <YXZpyWesc8VRWYwr@octopus.int.carobme.de>
On 25.10.21 10:24, Marco Beck wrote:
Show 15 quoted lines
> On Mon, Oct 25, 2021 at 09:31:33AM +0200, Fabian Stelzer wrote: > >> [includeIf "gitdir:~/projects/work/"] >> path = ".gitconfig.work" > > Yeah, that's what I added to my config recently just for signing key > selection. I'm using direnv[1] for some time now to switch between > different "profiles" (more than just Git settings) by just setting > some environment variables and it was nice to have everything in one > place. That's why I disliked adding the includeIf to my .gitconfig. > > Thanks anyway, > Marco > > [1] https://direnv.net/
If you insist on using environment variables there is: GIT_CONFIG_KEY_<n> GIT_CONFIG_VALUE_<n>
https://git-scm.com/docs/git-config
A bit clunky in my opinion but you can set any config variable via env vars:
e.g.: GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=user.name GIT_CONFIG_VALUE_0=testing