The reason for this is that the precedence rules were never well
specified, and this made many sane-looking uses of "test -a/-o" problematic.
For example, if $x is "=", these work according to POSIX (it's not
portable, but in practice it's okay):
$ test -z "$x"
$ test -z "$x" && test a = b
but this doesn't
$ test -z "$x" -a a = b
bash: test: too many arguments
because it groups "test -n = -a" and is left with "a = b".
Similarly, if $x is "-f", these
$ test "$x"
$ test "$x" || test c = d
correctly adds an implicit "-n", but this fails:
$ test "$x" -o c = d
bash: test: too many arguments
If anybody cleans up git's usage of test -a/-o, feel free to cut'n'paste
the above into the commit messages.
Paolo
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html