{"thread":{"id":"11763","subject":"Configuration overrides via environment variable","startedAt":"2008-01-28T01:08:10Z","lastAt":"2008-01-28T23:11:05Z","messageCount":4,"participants":["David Symonds","Jan Hudec","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"66702","messageId":"ee77f5c20801271708k124dc9d7n942b3c95299cb7fb@mail.gmail.com","threadId":"11763","inReplyTo":null,"subject":"Configuration overrides via environment variable","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2008-01-28T01:08:10Z","receivedAt":"2008-01-28T01:08:10Z","isPatch":false,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"Hi,\n\nI'm using Git in some scripts, and wanted to get its colorised output\neven when it is not going to a tty. I don't want to permanently change\n~/.gitconfig or the per-repo config; I just want to set color.status\n(and perhaps others) to \"always\" for a one-off run. I suppose I could\nmunge the config files, storing the previous value and restoring it\nlater, but that's messy.\n\nIdeally, an environment variable like GIT_EXTRA_CONFIG or something\nwould be nice, so I could just do:\n\nGIT_EXTRA_CONFIG=\"color.status=always\" git status | ...\n\nThoughts? Does this already exist, and I've overlooked it?\n\n\nDave.\n"},{"id":"66757","messageId":"20080128205837.GB5788@efreet.light.src","threadId":"11763","inReplyTo":"ee77f5c20801271708k124dc9d7n942b3c95299cb7fb@mail.gmail.com","subject":"Re: Configuration overrides via environment variable","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2008-01-28T20:58:37Z","receivedAt":"2008-01-28T20:58:37Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Mon, Jan 28, 2008 at 12:08:10 +1100, David Symonds wrote:\n> Hi,\n> \n> I'm using Git in some scripts, and wanted to get its colorised output\n> even when it is not going to a tty. I don't want to permanently change\n> ~/.gitconfig or the per-repo config; I just want to set color.status\n> (and perhaps others) to \"always\" for a one-off run. I suppose I could\n> munge the config files, storing the previous value and restoring it\n> later, but that's messy.\n> \n> Ideally, an environment variable like GIT_EXTRA_CONFIG or something\n> would be nice, so I could just do:\n> \n> GIT_EXTRA_CONFIG=\"color.status=always\" git status | ...\n> \n> Thoughts? Does this already exist, and I've overlooked it?\n\nQuickly looking at the git-config manpage, there does not seem to be a way to\nprovide alternate config file via GIT_CONFIG and/or GIT_CONFIG_LOCAL\nvariables. I don't know how good match for your problem that would be.\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"},{"id":"66764","messageId":"m3tzkx8smg.fsf@localhost.localdomain","threadId":"11763","inReplyTo":"20080128205837.GB5788@efreet.light.src","subject":"Re: Configuration overrides via environment variable","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-01-28T22:58:39Z","receivedAt":"2008-01-28T22:58:39Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jan Hudec <bulb@ucw.cz> writes:\n\n> On Mon, Jan 28, 2008 at 12:08:10 +1100, David Symonds wrote:\n> > \n> > I'm using Git in some scripts, and wanted to get its colorised output\n> > even when it is not going to a tty. I don't want to permanently change\n> > ~/.gitconfig or the per-repo config; I just want to set color.status\n> > (and perhaps others) to \"always\" for a one-off run. I suppose I could\n> > munge the config files, storing the previous value and restoring it\n> > later, but that's messy.\n\nCannot you just use --color option?\n \n> > Ideally, an environment variable like GIT_EXTRA_CONFIG or something\n> > would be nice, so I could just do:\n> > \n> > GIT_EXTRA_CONFIG=\"color.status=always\" git status | ...\n> > \n> > Thoughts? Does this already exist, and I've overlooked it?\n> \n> Quickly looking at the git-config manpage, there does not seem to be a way to\n> provide alternate config file via GIT_CONFIG and/or GIT_CONFIG_LOCAL\n> variables. I don't know how good match for your problem that would be.\n\nGIT_CONFIG_LOCAL *replaces* repository configuration file; the global\nand the system-wide configuration files will still be read. GIT_CONFIG\nis the only config file read.\n\nSo you could I guess concatenate repo config with \"[color] status=always\",\nalthough you would get warnings if color.status is already set...\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"66765","messageId":"ee77f5c20801281511md7bdeeme383a140fdc854ec@mail.gmail.com","threadId":"11763","inReplyTo":"m3tzkx8smg.fsf@localhost.localdomain","subject":"Re: Configuration overrides via environment variable","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2008-01-28T23:11:05Z","receivedAt":"2008-01-28T23:11:05Z","isPatch":false,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On Jan 29, 2008 9:58 AM, Jakub Narebski <jnareb@gmail.com> wrote:\n> Jan Hudec <bulb@ucw.cz> writes:\n>\n> > On Mon, Jan 28, 2008 at 12:08:10 +1100, David Symonds wrote:\n> > >\n> > > I'm using Git in some scripts, and wanted to get its colorised output\n> > > even when it is not going to a tty. I don't want to permanently change\n> > > ~/.gitconfig or the per-repo config; I just want to set color.status\n> > > (and perhaps others) to \"always\" for a one-off run. I suppose I could\n> > > munge the config files, storing the previous value and restoring it\n> > > later, but that's messy.\n>\n> Cannot you just use --color option?\n\nMy version of Git (1.5.3.8) doesn't have a --color option for\ngit-status, and I can't find support for it in 'next', either. It\nwould be ideal if there was a --color option, though.\n\n\nDave.\n"}]}