git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH] coccicheck: fail "make" when it fails

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 22, 2025, 04:18 UTC
Message-ID
<xmqqa5608l3y.fsf@gitster.g>
In-Reply-To
<CAPig+cRtSzjA=P_-WhRw9rRmTmFMGibKuHYn_ZuN935fcffveg@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 13 quoted lines
> On Sat, Jun 21, 2025 at 2:29 AM Carlo Marcelo Arenas Belón
> <carenas@gmail.com> wrote:
>> On Thu, Jun 19, 2025 at 08:35:35AM -0800, Junio C Hamano wrote:
>> >  coccicheck: $(COCCICHECK_PATCHES_INTREE)
>> > +     test $$(cat $(COCCICHECK_PATCHES_INTREE) | wc -c) = 0
>>
>> Definitely a nitpick, but I think using `-eq` instead of `=`
>> and might even come handy from a portability point of view.
>
> Junio has previously expressed[*] a preference for `=` over `-eq` in
> this sort of situation.
>
> [*]: https://lore.kernel.org/git/7v8v3m50ds.fsf@alter.siamese.dyndns.org/
Heh, you have an infinite more memory than I have ;-) 

That one is 12 years ago or so, isn't it? Not that I changed my stance.

Having said that, I suspect
    ! grep -q ^ $(COCCICHECK_PATCHES_INTREE)

might have been easier to understand. We do not want any file with even a single line in it, and "grep -q" knows to short-circuit (i.e. if the first file in the COCCICHECK_PATCHES_INTREE list is not empty, it does not even bother to open the rest of the files).

Previous: Eric SunshineNext: Junio C Hamano
Message 5 of 6 in “coccicheck: fail "make" when it fails”
  1. coccicheck: fail "make" when it failsJunio C Hamano, Jun 19, 2025
  2. Jeff KingJun 21, 2025
  3. Carlo Marcelo Arenas BelónJun 21, 2025
  4. Eric SunshineJun 21, 2025
  5. Junio C HamanoJun 22, 2025
  6. coccicheck: fail "make" when it failsJunio C Hamano, Jun 23, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.