Subject: Re: [PATCHv4] bash completion: Support "divergence from upstream" messages in __git_ps1

From: Thomas Rast <[email-masked]>
Date: Wed, 16 Jun 2010 21:11:09 +0200

Junio C Hamano wrote:
> Andrew Sayers <[email-masked]> writes:
> > +#       You can
> > +#       override the value of GIT_PS1_SHOWUPSTREAM on a per-repository
> > +#       basis by setting the bash.showUpstream config variable.
> 
> That's totally backwards from it should be, isn't it?
> 
> Usually configuration variables are used to give you the default, and
> you use environment variables to override them.

Not in the bash completion.  The test for the environment variable is
cheap, so you use that to enable the feature and can then use configs
to tweak them at a per-repo level.  There is precedent with
GIT_PS1_SHOWDIRTYSTATE and bash.showDirtyState.

The comment above should state that this override only works if the
environment variable is also enabled, though.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch