Subject: Re: [PATCH v2 1/3] run-command: conditionally define locate_in_PATH()

From: Junio C Hamano <[email-masked]>
Date: Fri, 04 Aug 2023 09:44:44 -0700

Matthias Aßhauer <[email-masked]> writes:

> On Thu, 3 Aug 2023, Junio C Hamano wrote:
>
>> "Matthias Aßhauer via GitGitGadget"  <[email-masked]>
>> writes:
>>
>>> From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= <[email-masked]>
>>>
>>> This commit doesn't change any behaviour by itself, but allows us to easily
>>> define compat replacements for locate_in_PATH(). It prepares us for the next
>>> commit that adds a native Windows implementation of locate_in_PATH().
>>>
>>> Signed-off-by: Matthias Aßhauer <[email-masked]>
>>> ---
>>>  run-command.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/run-command.c b/run-command.c
>>> index 60c94198664..85fc1507288 100644
>>> --- a/run-command.c
>>> +++ b/run-command.c
>>> @@ -170,6 +170,7 @@ int is_executable(const char *name)
>>>  	return st.st_mode & S_IXUSR;
>>>  }
>>>
>>> +#ifndef locate_in_PATH
>>>  /*
>>>   * Search $PATH for a command.  This emulates the path search that
>>>   * execvp would perform, without actually executing the command so it
>>
>> Micronit.  The comment should be shared across different platform
>> implementations of this interface, so "#ifndef" would want to come
>> immediately after this comment, not before, I would think.
>
> I can see the first part applying to all implementations, but the last
> part about it not working on windows is specific to this
> implementation.
>
> I guess we could split the comment, if we wanted to make that clear.
>
>> It does not affect the correctness, of course ;-)

Let's not bother immediately before -rc0; letting people use "gitk"
during "git bisect" without having to type 5 extra keystrokes in the
upcoming release is a good outcome and we can touch up the in-code
comment later.

Thanks.