git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Ingo Br ückl
Message 11 of 11 in “Fix wrong failures in config test”
  1. Fix wrong failures in config testIngo Br ückl, Jan 10, 2011
  2. Jonathan NiederJan 10, 2011
  3. Ingo Br ücklJan 10, 2011
  4. Jonathan NiederJan 10, 2011
  5. Junio C HamanoJan 10, 2011
  6. Ingo Br ücklJan 10, 2011
  7. Jonathan NiederJan 10, 2011
  8. Junio C HamanoJan 10, 2011
  9. Jonathan NiederJan 10, 2011
  10. Ingo Br ücklJan 10, 2011
  11. Jonathan NiederJan 10, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.