]> git.ipfire.org Git - thirdparty/git.git/commit - GIT-VERSION-GEN
global: convert trivial usages of `test <expr> -a/-o <expr>`
authorPatrick Steinhardt <ps@pks.im>
Fri, 10 Nov 2023 10:01:15 +0000 (11:01 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 11 Nov 2023 00:21:00 +0000 (09:21 +0900)
commit13420028e5b119d27277d521f4d267212c5ca21c
tree4d5279a48a367ea27df13cbeb8e9ba1b1dae3808
parentdadef801b365989099a9929e995589e455c51fed
global: convert trivial usages of `test <expr> -a/-o <expr>`

Our coding guidelines say to not use `test` with `-a` and `-o` because
it can easily lead to bugs. Convert trivial cases where we still use
these to instead instead concatenate multiple invocations of `test` via
`&&` and `||`, respectively.

While not all of the converted instances can cause ambiguity, it is
worth getting rid of all of them regardless:

    - It becomes easier to reason about the code as we do not have to
      argue why one use of `-a`/`-o` is okay while another one isn't.

    - We don't encourage people to use these expressions.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
GIT-VERSION-GEN
configure.ac
contrib/subtree/git-subtree.sh
t/perf/perf-lib.sh
t/perf/run
t/valgrind/valgrind.sh