Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] Fix wrong failures in config test

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:50:21

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help