{"thread":{"id":"44174","subject":"[Q] would it be bad to make /etc/gitconfig runtime configurable?","startedAt":"2016-09-27T17:05:46Z","lastAt":"2016-10-03T16:24:17Z","messageCount":5,"participants":["Junio C Hamano","Jeff King","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"302721","messageId":"xmqqoa39p926.fsf@gitster.mtv.corp.google.com","threadId":"44174","inReplyTo":null,"subject":"[Q] would it be bad to make /etc/gitconfig runtime configurable?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-27T17:05:37Z","receivedAt":"2016-09-27T17:05:46Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The subject says it all.  Would it be bad if we introduce an\nenvironment variable, GIT_SYSTEM_CONFIG=/etc/gitconfig, that names\nan alternative location of the system-wide configuration file?\n\nThat would supersede/deprecate GIT_CONFIG_NOSYSTEM that we\nintroduced primarily so that we can run our tests without getting\naffected by the configuration that happens to be effective on the\nhost that the test is being run.\n\n"},{"id":"302747","messageId":"20160927192539.ybooc34iodnzs2ab@sigill.intra.peff.net","threadId":"44174","inReplyTo":"xmqqoa39p926.fsf@gitster.mtv.corp.google.com","subject":"Re: [Q] would it be bad to make /etc/gitconfig runtime configurable?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-09-27T19:25:40Z","receivedAt":"2016-09-27T19:25:47Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Sep 27, 2016 at 10:05:37AM -0700, Junio C Hamano wrote:\n\n> The subject says it all.  Would it be bad if we introduce an\n> environment variable, GIT_SYSTEM_CONFIG=/etc/gitconfig, that names\n> an alternative location of the system-wide configuration file?\n> \n> That would supersede/deprecate GIT_CONFIG_NOSYSTEM that we\n> introduced primarily so that we can run our tests without getting\n> affected by the configuration that happens to be effective on the\n> host that the test is being run.\n\nI can't think of a reason it would be bad. There shouldn't be a security\nquestion, as controlling the environment already lets you run arbitrary\ncode, override system config variables, etc.\n\nI know when I was writing the tests for 0d44a2d (config: return\nconfigset value for current_config_ functions, 2016-05-26) I had to omit\nthe \"system\" case, because we had no way of pointing at a specific file.\nSo I do not know whether a runtime system config variable would be\nuseful for users, but it would definitely make testing easier.\n\n-Peff\n"},{"id":"303081","messageId":"alpine.DEB.2.20.1610031303000.35196@virtualbox","threadId":"44174","inReplyTo":"20160927192539.ybooc34iodnzs2ab@sigill.intra.peff.net","subject":"Re: [Q] would it be bad to make /etc/gitconfig runtime configurable?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-10-03T11:06:10Z","receivedAt":"2016-10-03T11:06:42Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Sep 2016, Jeff King wrote:\n\n> On Tue, Sep 27, 2016 at 10:05:37AM -0700, Junio C Hamano wrote:\n> \n> > The subject says it all.  Would it be bad if we introduce an\n> > environment variable, GIT_SYSTEM_CONFIG=/etc/gitconfig, that names\n> > an alternative location of the system-wide configuration file?\n> > \n> > That would supersede/deprecate GIT_CONFIG_NOSYSTEM that we\n> > introduced primarily so that we can run our tests without getting\n> > affected by the configuration that happens to be effective on the\n> > host that the test is being run.\n> \n> I can't think of a reason it would be bad.\n\nI cannot think of any reason right now, either, but my gut tells me that\nthis needs to simmer a while in the backs of our minds, to give potential\nreasons a chance to come forward.\n\nWhat would be the use case, BTW? IOW what would it solve that cannot\nalready be solved by using XDG_CONFIG_HOME?\n\nCiao,\nDscho\n"},{"id":"303082","messageId":"20161003112654.3vca4zmctslcudfz@sigill.intra.peff.net","threadId":"44174","inReplyTo":"alpine.DEB.2.20.1610031303000.35196@virtualbox","subject":"Re: [Q] would it be bad to make /etc/gitconfig runtime configurable?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-10-03T11:26:54Z","receivedAt":"2016-10-03T11:27:02Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Oct 03, 2016 at 01:06:10PM +0200, Johannes Schindelin wrote:\n\n> Hi,\n> \n> On Tue, 27 Sep 2016, Jeff King wrote:\n> \n> > On Tue, Sep 27, 2016 at 10:05:37AM -0700, Junio C Hamano wrote:\n> > \n> > > The subject says it all.  Would it be bad if we introduce an\n> > > environment variable, GIT_SYSTEM_CONFIG=/etc/gitconfig, that names\n> > > an alternative location of the system-wide configuration file?\n> > > \n> > > That would supersede/deprecate GIT_CONFIG_NOSYSTEM that we\n> > > introduced primarily so that we can run our tests without getting\n> > > affected by the configuration that happens to be effective on the\n> > > host that the test is being run.\n> > \n> > I can't think of a reason it would be bad.\n> \n> I cannot think of any reason right now, either, but my gut tells me that\n> this needs to simmer a while in the backs of our minds, to give potential\n> reasons a chance to come forward.\n> \n> What would be the use case, BTW? IOW what would it solve that cannot\n> already be solved by using XDG_CONFIG_HOME?\n\nThe patches Junio posted later use it for the test suite (and I also\nhave had to skip some tests in the past related to system config because\nof its lack).\n\nI would also use it when doing git experiments on GitHub servers. We\nkeep several relevant config settings in /etc/gitconfig, so if I were to\nsay, build a new version of git and test how it repacked torvalds/linux,\nI need to make sure it picks up the same config. Usually I do it by\nbaking in the right /etc/gitconfig at build time, but it would be less\nannoying to be able to override it at run-time.\n\nI admit both of those are uses for git _developers_, though, not git\n_users_.\n\n-Peff\n"},{"id":"303094","messageId":"xmqq1szx8kpj.fsf@gitster.mtv.corp.google.com","threadId":"44174","inReplyTo":"20161003112654.3vca4zmctslcudfz@sigill.intra.peff.net","subject":"Re: [Q] would it be bad to make /etc/gitconfig runtime configurable?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-03T16:24:08Z","receivedAt":"2016-10-03T16:24:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I admit both of those are uses for git _developers_, though, not git\n> _users_.\n\nYes, this is meant for developers and not users.\n\nThe initial question probably should have stated more explicitly,\ne.g. \"I am wondering if it would be helpful to developers if we add\nthis thing; does anybody think of a reason why exposing it to end\nusers is a bad idea?\"\n"}]}