Subject: Re: [PATCH 8/8] check-whitespace: detect if no base_commit is provided

From: Junio C Hamano <[email-masked]>
Date: Mon, 08 Jul 2024 10:19:27 -0700

Chris Torek <[email-masked]> writes:

> On Mon, Jul 8, 2024 at 3:35 AM Georg Pfuetzenreuter <[email-masked]> wrote:
>> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html states
>>
>> "The XSI extensions specifying the -a and -o binary primaries and the
>> '(' and ')' operators have been marked obsolescent."
>>
>> suggesting "&&" being preferred over "-a".
>
> That's annoying, I wonder why they did that.

Consult Documentation/CodingGuidelines?

 - We do not write our "test" command with "-a" and "-o" and use "&&"
   or "||" to concatenate multiple "test" commands instead, because
   the use of "-a/-o" is often error-prone.  E.g.

     test -n "$x" -a "$a" = "$b"

   is buggy and breaks when $x is "=", but

     test -n "$x" && test "$a" = "$b"

   does not have such a problem.