Re: [PATCH 01/12] tests: add initial bash completion tests

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

 



Felipe Contreras <felipe.contreras@xxxxxxxxx> writes:

> On Sun, Apr 8, 2012 at 7:25 AM, Junio C Hamano <gitster@xxxxxxxxx> 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.
--
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]