Re: [PATCH] Fix wrong failures in config test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ingo BrÃckl wrote:
> As Jonathan and Junio stated,

>>  envvar=value git command
>
>>  GIT_CONFIG=other-config git config anwohner.park ausweis
>
> shouldn't affect the environment of the tests.
>
> Unfortunately, I had a shell alias function named git that interfered. In
> fact it passes to the git program (command git "$@") but sadly does not know
> about the newly set PATH and (still inexplicably to me) makes the variable
> set.

For what it's worth, here's what POSIX[1] has to say:

	When a given simple command is required to be executed [...] the
	following expansions, assignments, and redirections shall all be
	performed from the beginning of the command text to the end:
[...]
	If no command name results, variable assignments shall affect
	the current execution environment. Otherwise, the variable
	assignments shall be exported for the execution environment of
	the command and shall not affect the current execution
	environment (except for special built-ins). 

I am guessing the expansion of your 'git' alias starts with a special
builtin.  For the future, it is probably best to guard settings for
interactive use with

	if test "${PS1+set}"
	then
		CDPATH=something
		alias foo=bar
		alias baz=qux
		...
	fi

or even better,

	case $- in
	*i*)
		CDPATH=something
		...
	esac

Thanks for explaining.
Jonathan

[1] http://unix.org/2008edition/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]