All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Karthik Nayak <karthik.188@gmail.com>
Cc: Justin Tobler <jltobler@gmail.com>,
	 git@vger.kernel.org,  Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH 4/4] meson: add rule to run 'git clang-format'
Date: Mon, 30 Jun 2025 08:24:54 -0700	[thread overview]
Message-ID: <xmqq4ivx5k1l.fsf@gitster.g> (raw)
In-Reply-To: <CAOLa=ZQD71Z4GSRNCuV=YL1zwGOXa-sGzpU9=8yfVcg6vJA6SQ@mail.gmail.com> (Karthik Nayak's message of "Mon, 30 Jun 2025 01:34:48 -0700")

Karthik Nayak <karthik.188@gmail.com> writes:

>>>>> +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.

  reply	other threads:[~2025-06-30 15:24 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25 16:43 [PATCH 0/4] clang-format: modify rules to reduce false-positives Karthik Nayak
2025-06-25 16:43 ` [PATCH 1/4] editorconfig: set maximum line length to 120 characters Karthik Nayak
2025-06-25 18:41   ` Junio C Hamano
2025-06-26  8:27     ` Karthik Nayak
2025-06-26 14:25       ` Junio C Hamano
2025-06-27  8:38         ` Karthik Nayak
2025-06-26 16:22   ` Justin Tobler
2025-06-27  8:51     ` Karthik Nayak
2025-06-27 15:12       ` Justin Tobler
2025-06-30  8:29         ` Karthik Nayak
2025-06-25 16:43 ` [PATCH 2/4] clang-format: set 'ColumnLimit' to 0 Karthik Nayak
2025-06-25 16:43 ` [PATCH 3/4] clang-format: add 'RemoveBracesLLVM' to the main config Karthik Nayak
2025-06-25 16:43 ` [PATCH 4/4] meson: add rule to run 'git clang-format' Karthik Nayak
2025-06-26 16:35   ` Justin Tobler
2025-06-27  8:12     ` Karthik Nayak
2025-06-27 14:25       ` Junio C Hamano
2025-06-30  8:34         ` Karthik Nayak
2025-06-30 15:24           ` Junio C Hamano [this message]
2025-06-30  8:38 ` [PATCH v2 0/3] clang-format: modify rules to reduce false-positives Karthik Nayak
2025-06-30  8:38   ` [PATCH v2 1/3] clang-format: set 'ColumnLimit' to 0 Karthik Nayak
2025-06-30  8:38   ` [PATCH v2 2/3] clang-format: add 'RemoveBracesLLVM' to the main config Karthik Nayak
2025-06-30  8:38   ` [PATCH v2 3/3] meson: add rule to run 'git clang-format' Karthik Nayak
2025-07-01 10:13     ` Patrick Steinhardt
2025-07-01 15:08       ` Karthik Nayak
2025-07-01 16:02       ` Junio C Hamano
2025-07-01 13:26     ` Toon Claes
2025-07-01 15:12       ` Karthik Nayak
2025-07-02  2:54         ` Patrick Steinhardt
2025-06-30 15:27   ` [PATCH v2 0/3] clang-format: modify rules to reduce false-positives Junio C Hamano
2025-07-01 13:36   ` Toon Claes
2025-07-01 15:19     ` Karthik Nayak
2025-07-01 20:49     ` Junio C Hamano
2025-07-02  9:23 ` [PATCH v3 " Karthik Nayak
2025-07-02  9:23   ` [PATCH v3 1/3] clang-format: set 'ColumnLimit' to 0 Karthik Nayak
2025-07-02  9:23   ` [PATCH v3 2/3] clang-format: add 'RemoveBracesLLVM' to the main config Karthik Nayak
2025-07-02  9:23   ` [PATCH v3 3/3] meson: add rule to run 'git clang-format' Karthik Nayak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq4ivx5k1l.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=jltobler@gmail.com \
    --cc=karthik.188@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.