git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Support environment variables in config file

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 4, 2007, 17:59 UTC
Message-ID
<Pine.LNX.4.64.0706041856270.4046@racer.site>
In-Reply-To
<20070604174719.GH16637@admingilde.org>
Hi,
On Mon, 4 Jun 2007, Martin Waitz wrote:
Show 5 quoted lines
> On Mon, Jun 04, 2007 at 04:57:35PM +0100, Johannes Schindelin wrote:
> > I actually would like it more if the calling program did the 
> > interpolation itself.
> 
> That's another possibility, perhaps along the line of git_config_int.
Maybe...
Show 7 quoted lines
> > So, for example if you want a script to access whatever.my.url, and 
> > want to allow to interpolate any environment variable, why not
> > 
> > 	url=$(eval $(git config whatever.my.url))
> 
> Well, complete shell syntax does too much: it also supports $() and 
> friends.
Good point.
Show 8 quoted lines
> > I am just hesitant to change the existing behaviour, and possibly 
> > introduce weird breakages. (There could even be some unwanted env 
> > leakages in programs like gitweb...)
> 
> exactly.
> 
> So should we simply update semantics of config variables to not require 
> any environment variables?

Well, actually there is a perfect example when you would want to do even more than just expanding environment variables: aliases.

I'm happy to understand the config as a relatively versatile key/value store, without much in the way of pre- or post-processing from git-config or git_config().

But if there are a few callers of git_config() which want environment variable interpolation, git_config_expand_envs() would be good.

Ciao, Dscho

Previous: Martin Waitz
Message 7 of 7 in “Support environment variables in config file”
  1. Support environment variables in config fileMartin Waitz, Jun 3, 2007
  2. Matthias LederhoferJun 4, 2007
  3. Martin WaitzJun 4, 2007
  4. Matthias LederhoferJun 4, 2007
  5. Johannes SchindelinJun 4, 2007
  6. Martin WaitzJun 4, 2007
  7. Johannes SchindelinJun 4, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.