Re: [PATCH 01/12] tests: add initial bash completion tests
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 11, 2012, 23:49 UTC
- Message-ID
- <7v1untj0cl.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CAMP44s2EunUabZdU23e+jYnBrWtBmhZeqt9yR+wV3X9HZhd7hA@mail.gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 8 quoted lines
> On Sun, Apr 8, 2012 at 7:25 AM, Junio C Hamano <gitster@pobox.com> wrote: > ... >> What shell do you use on your system as /bin/sh (or if you use SHELL_PATH >> in the Makefile to override it, what do you use)? > > /bin/sh is a symlink to bash on my system, and although bash defines > POSIXLY_CORRECT, the tests pass just fine. I even tried to run /bin/sh > --posix.
It really depends on what's in contrib/git-completion.bash and what you test.
For example, if a (possibly future) version of completion script had lines like these (taken from 6486ca6d7):
__some_function ()
{
...
while read key value; do
...
done < <(git config -z --get-regexp ...
...
}invoking "bash --posix" would have failed like this:
$ bash --posix
bash-4.1$ _a ()
> {
> while read x; do
> echo "* $x"
> done < <(echo a; echo b)
bash: syntax error near unexpected token `<'Perhaps the "initial tests" you posted, together with the version of the completion script we happen to have near 'master', didn't have any construct that gives a visible failure like the above, but that is just by dumb luck and is not a reason for us to be complacent and not to be careful.
The early part of your re-roll (i.e. v2) seems to be done carefully to make sure we run the script in full-fledged bash, from a quick glance.
Thanks.