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

Re: [PATCH] mingw_rename: do support directory renames

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 17, 2024, 20:09 UTC
Message-ID
<xmqqy10eysuz.fsf@gitster.g>
In-Reply-To
<pull.1839.git.1734439924842.gitgitgadget@gmail.com>

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:

Show 21 quoted lines
>     This is not quite a critical bug fix for Git because (unlike Git for
>     Windows) it attempts _wrename() first. If that succeeds, we'll not
>     bother with the POSIX semantics.
>     
>     However, Git for Windows knows how to deal with symbolic links, and
>     _wrename() does not work for them. Therefore, that _wrename() call was
>     patched out there and we rely on the native Win32 API call to
>     SetFileInformationByHandle() to rename files and directories.
>     
>     It is that latter part that is at heart of this here bug fix: To be able
>     to call SetFileInformationByHandle(), we need a handle, and
>     CreateFileW() is what we use, for files, and crucially, also for
>     directories.
>     
>     So while it is not critical for Git to take this patch, it still is
>     important because that _wrename() call can fail, even when renaming
>     directories, and then we want the fallback to fail not because we tried
>     to obtain a handle using incorrect flags, but only because the actual
>     rename operation failed.
>     
>     This patch is based on ps/mingw-rename.
Thanks.

As this will be part of GfW 2.48 anyway (I presume), let me take it and include it in my tree to keep the divergence between our trees small.

Previous: Johannes Schindelin via GitGitGadgetNext: Patrick Steinhardt
Message 2 of 3 in “mingw_rename: do support directory renames”
  1. mingw_rename: do support directory renamesJohannes Schindelin via GitGitGadget, Dec 17, 2024
  2. Junio C HamanoDec 17, 2024
  3. Patrick SteinhardtDec 18, 2024

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.