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

Re: [Q] would it be bad to make /etc/gitconfig runtime configurable?

From
Jeff King <peff@peff.net>
Date
Oct 3, 2016, 11:26 UTC
Message-ID
<20161003112654.3vca4zmctslcudfz@sigill.intra.peff.net>
In-Reply-To
<alpine.DEB.2.20.1610031303000.35196@virtualbox>
On Mon, Oct 03, 2016 at 01:06:10PM +0200, Johannes Schindelin wrote:
Show 23 quoted lines
> Hi,
> 
> On Tue, 27 Sep 2016, Jeff King wrote:
> 
> > On Tue, Sep 27, 2016 at 10:05:37AM -0700, Junio C Hamano wrote:
> > 
> > > The subject says it all.  Would it be bad if we introduce an
> > > environment variable, GIT_SYSTEM_CONFIG=/etc/gitconfig, that names
> > > an alternative location of the system-wide configuration file?
> > > 
> > > That would supersede/deprecate GIT_CONFIG_NOSYSTEM that we
> > > introduced primarily so that we can run our tests without getting
> > > affected by the configuration that happens to be effective on the
> > > host that the test is being run.
> > 
> > I can't think of a reason it would be bad.
> 
> I cannot think of any reason right now, either, but my gut tells me that
> this needs to simmer a while in the backs of our minds, to give potential
> reasons a chance to come forward.
> 
> What would be the use case, BTW? IOW what would it solve that cannot
> already be solved by using XDG_CONFIG_HOME?

The patches Junio posted later use it for the test suite (and I also have had to skip some tests in the past related to system config because of its lack).

I would also use it when doing git experiments on GitHub servers. We keep several relevant config settings in /etc/gitconfig, so if I were to say, build a new version of git and test how it repacked torvalds/linux, I need to make sure it picks up the same config. Usually I do it by baking in the right /etc/gitconfig at build time, but it would be less annoying to be able to override it at run-time.

I admit both of those are uses for git _developers_, though, not git _users_.

-Peff
Previous: Johannes SchindelinNext: Junio C Hamano
Message 4 of 5 in “[Q] would it be bad to make /etc/gitconfig runtime configurable?”
  1. Junio C HamanoSep 27, 2016
  2. Jeff KingSep 27, 2016
  3. Johannes SchindelinOct 3, 2016
  4. Jeff KingOct 3, 2016
  5. Junio C HamanoOct 3, 2016

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.