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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 4, 2023, 16:44 UTC
Message-ID
<xmqq5y5u3gg3.fsf@gitster.g>
In-Reply-To
<AS1P250MB0701991FBCA2E37BD5238497A509A@AS1P250MB0701.EURP250.PROD.OUTLOOK.COM>
Matthias Aßhauer <mha1993@live.de> writes:
Show 40 quoted lines
> On Thu, 3 Aug 2023, Junio C Hamano wrote:
>
>> "Matthias Aßhauer via GitGitGadget"  <gitgitgadget@gmail.com>
>> writes:
>>
>>> From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= <mha1993@live.de>
>>>
>>> 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 <mha1993@live.de>
>>> ---
>>>  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.
Previous: Matthias AßhauerNext: Matthias Aßhauer via GitGitGadget
Message 15 of 23 in “git bisect visualize: find gitk on Windows again”
  1. 0/3 git bisect visualize: find gitk on Windows againMatthias Aßhauer via GitGitGadget, Aug 3, 2023
  2. 1/3 compat: make path_lookup() available outside mingw.cMatthias Aßhauer via GitGitGadget, Aug 3, 2023
  3. 3/3 docs: update when `git bisect visualize` uses `gitk`Matthias Aßhauer via GitGitGadget, Aug 3, 2023
  4. Junio C HamanoAug 3, 2023
  5. 2/3 run-command: teach locate_in_PATH about WindowsMatthias Aßhauer via GitGitGadget, Aug 3, 2023
  6. Junio C HamanoAug 3, 2023
  7. Junio C HamanoAug 3, 2023
  8. Junio C HamanoAug 3, 2023
  9. Matthias AßhauerAug 3, 2023
  10. Junio C HamanoAug 3, 2023
  11. 0/3 git bisect visualize: find gitk on Windows againMatthias Aßhauer via GitGitGadget, Aug 4, 2023
  12. 1/3 run-command: conditionally define locate_in_PATH()Matthias Aßhauer via GitGitGadget, Aug 4, 2023
  13. Junio C HamanoAug 4, 2023
  14. Matthias AßhauerAug 4, 2023
  15. Junio C HamanoAug 4, 2023
  16. 3/3 docs: update when `git bisect visualize` uses `gitk`Matthias Aßhauer via GitGitGadget, Aug 4, 2023
  17. Junio C HamanoAug 4, 2023
  18. Eric SunshineAug 4, 2023
  19. Matthias AßhauerAug 4, 2023
  20. Junio C HamanoAug 4, 2023
  21. Eric SunshineAug 4, 2023
  22. 2/3 compat/mingw: implement a native locate_in_PATH()Matthias Aßhauer via GitGitGadget, Aug 4, 2023
  23. Junio C HamanoAug 4, 2023

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.