From: Jonathan Nieder <jrnieder@gmail.com>
To: "Ingo Brückl" <ib@wupperonline.de>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] Fix wrong failures in config test
Date: Mon, 10 Jan 2011 13:42:42 -0600 [thread overview]
Message-ID: <20110110194242.GA11801@burratino> (raw)
In-Reply-To: <4d2b5c52.68e3cdc2.bm000@wupperonline.de>
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/
next prev parent reply other threads:[~2011-01-10 19:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-10 16:13 [PATCH] Fix wrong failures in config test Ingo Brückl
2011-01-10 16:52 ` Jonathan Nieder
2011-01-10 17:15 ` Ingo Brückl
2011-01-10 17:29 ` Jonathan Nieder
2011-01-10 18:30 ` Junio C Hamano
2011-01-10 19:21 ` Ingo Brückl
2011-01-10 19:42 ` Jonathan Nieder [this message]
2011-01-10 21:30 ` Junio C Hamano
2011-01-10 21:33 ` Jonathan Nieder
2011-01-10 21:50 ` Ingo Brückl
[not found] ` <4d2b7b68.47102a21.bm000@wupperonline.de>
2011-01-10 21:59 ` Jonathan Nieder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110110194242.GA11801@burratino \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=ib@wupperonline.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).