Re: [PATCH] t/test-lib.sh: do not trust $SHELL
- From
Jeff King <peff@peff.net>
- Date
- Sep 21, 2012, 21:12 UTC
- Message-ID
- <20120921211217.GA24134@sigill.intra.peff.net>
- In-Reply-To
- <CALkWK0kRzN_yQZ1JqJogBs6Z1nLhofBijHzeWR5YfQYHOtpaBA@mail.gmail.com>
On Sat, Sep 22, 2012 at 02:37:38AM +0530, Ramkumar Ramachandra wrote:
Show 6 quoted lines
> > I don't think that is the right thing to do. The point of SHELL is to > > point at a bourne-compatible shell. On some systems, the main reason to > > set it is that /bin/sh is _broken_, and we are trying to avoid it. > > But you're only avoiding it in the --tee/ --va* codepath. In the > normal codepath, you're stuck with /bin/sh anyway.
No, the #!-header is only information. When you run "make test" we actually invoke the shell ourselves using $SHELL_PATH.
> > A bigger question is: why are you setting SHELL=zsh in the first place? > > I use ZSH as my primary shell, so SHELL is set to zsh when I run > tests. How can we trust $SHELL to be a bourne-compatible shell?
Ah, my fault. I was thinking we overrode $SHELL along with $SHELL_PATH, but we do not.
The correct patch is to stop using $SHELL, but not to switch to a manual /bin/sh. It should use $SHELL_PATH instead, which is how you tell git your path to a sane bourne shell.
-Peff