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

Re: [PATCH] fsmonitor: handle differences between Windows named pipe functions

From
JHJeff Hostetler <git@jeffhostetler.com>
Date
Mar 27, 2023, 15:02 UTC
Message-ID
<b9cf67e4-22a7-2ff0-8310-9223bea10d6d@jeffhostetler.com>
In-Reply-To
<e48e768a-19f3-386a-9bda-8fa8681d1a6c@gmx.de>
On 3/27/23 7:37 AM, Johannes Schindelin wrote:
Show 43 quoted lines
> Hi Eric,
> 
> On Fri, 24 Mar 2023, Eric DeCosta via GitGitGadget wrote:
> 
>> From: Eric DeCosta <edecosta@mathworks.com>
>>
>> CreateNamedPipeW is perfectly happy accepting pipe names with seemingly
>> embedded escape charcters (e.g. \b), WaitNamedPipeW is not and incorrectly
>> returns ERROR_FILE_NOT_FOUND when clearly a named pipe, succesfully created
>> with CreateNamedPipeW, exists.
>>
>> For example, this network path is problemmatic:
>> \\batfs-sb29-cifs\vmgr\sbs29\my_git_repo
>>
>> In order to work around this issue, rather than using the path to the
>> worktree directly as the name of the pipe, instead use the hash of the
>> worktree path.
> 
> This is a rather large deviation from the other platforms, and it has an
> unwanted side effect: Git for Windows' installer currently enumerates the
> named pipes to figure out which FSMonitor instances need to be stopped
> before upgrading. It has to do that because it would otherwise be unable
> to overwrite the Git executable. And it needs to know the paths [*1*] so
> that it can stop the FSMonitors gracefully (as opposed to terminating them
> and risk interrupting them while they serve a reply to a Git client).
> 
> A much less intrusive change (that would not break Git for Windows'
> installer) would be to replace backslashes by forward slashes in the path.
> 
> Please do that instead.
> 
> Ciao,
> Johannes
> 
> Footnote *1*: If you think that the Git for Windows installer could simply
> enumerate the process IDs of the FSMonitor instances and then look for
> their working directories: That is not a viable option. Not only does the
> Windows-based FSMonitor specifically switch to the parent directory (to
> avoid blocking the removal of a Git directory merely by running the
> process in said directory), even worse: there is no officially-sanctioned
> way to query a running process' current working directory (the only way I
> know of involves injecting a remote thread! Which will of course risk
> being labeled as malware by current anti-malware solutions).
Agreed. Please use forward slashes.

Thanks, Jeff

Previous: Johannes SchindelinNext: Junio C Hamano
Message 3 of 12 in “fsmonitor: handle differences between Windows named pipe functions”
  1. fsmonitor: handle differences between Windows named pipe functionsEric DeCosta via GitGitGadget, Mar 24, 2023
  2. Johannes SchindelinMar 27, 2023
  3. Jeff HostetlerMar 27, 2023
  4. Junio C HamanoMar 27, 2023
  5. Eric DeCostaApr 6, 2023
  6. Jeff HostetlerApr 7, 2023
  7. fsmonitor: handle differences between Windows named pipe functionsEric DeCosta via GitGitGadget, Apr 10, 2023
  8. Eric DeCostaApr 22, 2023
  9. Jeff HostetlerApr 26, 2023
  10. Jeff HostetlerApr 27, 2023
  11. Eric DeCostaMay 8, 2023
  12. Jeff HostetlerMay 15, 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.