Re: [PATCH] Fix wrong failures in config test
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jan 10, 2011, 21:59 UTC
- Message-ID
- <20110110215933.GB12030@burratino>
- In-Reply-To
- <4d2b7b68.47102a21.bm000@wupperonline.de>
Ingo Brückl wrote:
> It's a function (available in login shells and thus during the test suite):
The test suite doesn't run in a login shell. As I hinted before, you can put
case "$-" in *i*) # interactive shell ;; *) return 0 esac
in your .bashrc before the function definition and all should be well.
> From what I've learned from you now, if 'git' is an exported bash function, > 'VAR=val git' will always automatically result in VAR being exported
I didn't understand at first why this particular vintage of bash makes VAR leak into the current environment. I tried to reproduce it with Debian bash 3.2-4 (which is based on bash 3.2.39(1)-release) with no success.
In any event git avoids
VAR=val fn
when fn is a function for this and possibly other reasons (see [1]).
I do not think git ought to guard against a git function (or alias) in the user's environment, even though doing so might lead to a better user experience and less confusion on the mailing list. git does not protect against 'rm' being an alias to 'rm -i' or 'svn' being an alias, either.
Regards, Jonathan
[1] http://thread.gmane.org/gmane.comp.version-control.git/135766/focus=137095