Re: [PATCH 4/4] meson: add rule to run 'git clang-format'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 27, 2025, 14:25 UTC
- Message-ID
- <xmqqtt418dnw.fsf@gitster.g>
- In-Reply-To
- <CAOLa=ZSJH-Wji+-oU+ku5aojYzEuC96tUu+24UTuTxCxt9LYNQ@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 15 quoted lines
>>> diff --git a/meson.build b/meson.build
>>> index 7fea4a34d6..578db26df2 100644
>>> --- a/meson.build
>>> +++ b/meson.build
>>> @@ -2144,6 +2144,18 @@ if headers_to_check.length() != 0 and compiler.get_argument_syntax() == 'gcc'
>>> alias_target('check-headers', hdr_check)
>>> endif
>>>
>>> +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.