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

Re: [PATCH 4/4] meson: add rule to run 'git clang-format'

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 30, 2025, 15:24 UTC
Message-ID
<xmqq4ivx5k1l.fsf@gitster.g>
In-Reply-To
<CAOLa=ZQD71Z4GSRNCuV=YL1zwGOXa-sGzpU9=8yfVcg6vJA6SQ@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 24 quoted lines
>>>>> +clang_format = find_program('clang-format', required: false)
>>>>
>>>> Should we be checking for `git-clang-format` instead?
>>>
>>> Yeah. While `git-clang-format` is packaged with `clang-format`, it does
>>> make more sense to check for the former.
>>
>> Just for my education, what does find_program() look for?  Installed
>> packages, or a program on your $PATH?  I am guessing that the answer
>> is the latter, in which case it is not like "it makes more sense to
>> check for git-clang-format"---rather it is "it would not work at all
>> if we looked for clang-format", no?
>>
>> Thanks.
>
> Good question. To quote from the documentation [1]:
>
>   find_program()
>
>   program_name here is a string that can be an executable or script to
>   be searched for in PATH or other places inside the project.
>
> So, 'git-clang-format' would work. I've also verified the same on my
> end.

I think that much everybody would know by what other uses of find_program() are looking for by checking "git grep find_program" output.

I was confused by your "it does make *MORE* sense to check for the former" (emphasis mine), as if you were saying that both would work but using 'git-clang-format' would be a more kosher way to express what we want. Given that it would not work at all if you used 'clang-format' instead, that statement was misleading.

So the response I was expecting in the message I am responding to was more like "'clang-format' would *not* work at all, and we must check 'git-clang-format' instead".

Thanks.
Previous: Karthik NayakNext: Karthik Nayak
Message 18 of 36 in “clang-format: modify rules to reduce false-positives”
  1. 0/4 clang-format: modify rules to reduce false-positivesKarthik Nayak, Jun 25, 2025
  2. 1/4 editorconfig: set maximum line length to 120 charactersKarthik Nayak, Jun 25, 2025
  3. Junio C HamanoJun 25, 2025
  4. Karthik NayakJun 26, 2025
  5. Junio C HamanoJun 26, 2025
  6. Karthik NayakJun 27, 2025
  7. Justin ToblerJun 26, 2025
  8. Karthik NayakJun 27, 2025
  9. Justin ToblerJun 27, 2025
  10. Karthik NayakJun 30, 2025
  11. 2/4 clang-format: set 'ColumnLimit' to 0Karthik Nayak, Jun 25, 2025
  12. 3/4 clang-format: add 'RemoveBracesLLVM' to the main configKarthik Nayak, Jun 25, 2025
  13. 4/4 meson: add rule to run 'git clang-format'Karthik Nayak, Jun 25, 2025
  14. Justin ToblerJun 26, 2025
  15. Karthik NayakJun 27, 2025
  16. Junio C HamanoJun 27, 2025
  17. Karthik NayakJun 30, 2025
  18. Junio C HamanoJun 30, 2025
  19. 0/3 clang-format: modify rules to reduce false-positivesKarthik Nayak, Jun 30, 2025
  20. 1/3 clang-format: set 'ColumnLimit' to 0Karthik Nayak, Jun 30, 2025
  21. 2/3 clang-format: add 'RemoveBracesLLVM' to the main configKarthik Nayak, Jun 30, 2025
  22. 3/3 meson: add rule to run 'git clang-format'Karthik Nayak, Jun 30, 2025
  23. Patrick SteinhardtJul 1, 2025
  24. Karthik NayakJul 1, 2025
  25. Junio C HamanoJul 1, 2025
  26. Toon ClaesJul 1, 2025
  27. Karthik NayakJul 1, 2025
  28. Patrick SteinhardtJul 2, 2025
  29. Junio C HamanoJun 30, 2025
  30. Toon ClaesJul 1, 2025
  31. Karthik NayakJul 1, 2025
  32. Junio C HamanoJul 1, 2025
  33. 0/3 clang-format: modify rules to reduce false-positivesKarthik Nayak, Jul 2, 2025
  34. 1/3 clang-format: set 'ColumnLimit' to 0Karthik Nayak, Jul 2, 2025
  35. 2/3 clang-format: add 'RemoveBracesLLVM' to the main configKarthik Nayak, Jul 2, 2025
  36. 3/3 meson: add rule to run 'git clang-format'Karthik Nayak, Jul 2, 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.