Thread (2 messages) flat view 2 messages, 2 authors, 2021-10-25

Re: [PATCH] completion: fix incorrect bash/zsh string equality check

From: Junio C Hamano <hidden>
Date: 2021-10-08 23:09:07

Robert Estelle [off-list ref] writes:
The choice between the two does not affect correctness, it's purely
stylistic here. It only would affect correctness for unquoted
arguments or extended comparison operators. Those *are* in use
elsewhere in this script and force the use of `[[` in those places.

Keep in mind also that this is an autocomplete script. Although it's
sourced by both bash and zsh, it does not make sense to attempt to
make it work for bare POSIX sh.
Nobody is trying to.  It is more for reducing the risk of people
shooting their foot by cutting and pasting without thinking.

When you do not mean pattern matching and want exact matching, even
if it is guaranteed that the data you pass through the codepath does
not have pattern to cause the former, hence the distinction between
[[ x == y ]] and [ x = y ] does not make a difference, that is a
mere happenstance, and use of [ x = y ] is the correct thing to do
in such a case.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help