git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Jan Hudec <bulb@ucw.cz>
Cc: David Symonds <dsymonds@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Configuration overrides via environment variable
Date: Mon, 28 Jan 2008 14:58:39 -0800 (PST)	[thread overview]
Message-ID: <m3tzkx8smg.fsf@localhost.localdomain> (raw)
In-Reply-To: <20080128205837.GB5788@efreet.light.src>

Jan Hudec <bulb@ucw.cz> writes:

> On Mon, Jan 28, 2008 at 12:08:10 +1100, David Symonds wrote:
> > 
> > I'm using Git in some scripts, and wanted to get its colorised output
> > even when it is not going to a tty. I don't want to permanently change
> > ~/.gitconfig or the per-repo config; I just want to set color.status
> > (and perhaps others) to "always" for a one-off run. I suppose I could
> > munge the config files, storing the previous value and restoring it
> > later, but that's messy.

Cannot you just use --color option?
 
> > Ideally, an environment variable like GIT_EXTRA_CONFIG or something
> > would be nice, so I could just do:
> > 
> > GIT_EXTRA_CONFIG="color.status=always" git status | ...
> > 
> > Thoughts? Does this already exist, and I've overlooked it?
> 
> Quickly looking at the git-config manpage, there does not seem to be a way to
> provide alternate config file via GIT_CONFIG and/or GIT_CONFIG_LOCAL
> variables. I don't know how good match for your problem that would be.

GIT_CONFIG_LOCAL *replaces* repository configuration file; the global
and the system-wide configuration files will still be read. GIT_CONFIG
is the only config file read.

So you could I guess concatenate repo config with "[color] status=always",
although you would get warnings if color.status is already set...

-- 
Jakub Narebski
Poland
ShadeHawk on #git

  reply	other threads:[~2008-01-28 22:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-28  1:08 Configuration overrides via environment variable David Symonds
2008-01-28 20:58 ` Jan Hudec
2008-01-28 22:58   ` Jakub Narebski [this message]
2008-01-28 23:11     ` David Symonds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3tzkx8smg.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=bulb@ucw.cz \
    --cc=dsymonds@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).