From: Junio C Hamano <gitster@pobox.com>
To: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Patrick Steinhardt <ps@pks.im>,
Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [PATCH] mingw_rename: do support directory renames
Date: Tue, 17 Dec 2024 12:09:08 -0800 [thread overview]
Message-ID: <xmqqy10eysuz.fsf@gitster.g> (raw)
In-Reply-To: <pull.1839.git.1734439924842.gitgitgadget@gmail.com> (Johannes Schindelin via GitGitGadget's message of "Tue, 17 Dec 2024 12:52:04 +0000")
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:
> 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.
next prev parent reply other threads:[~2024-12-17 20:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 12:52 [PATCH] mingw_rename: do support directory renames Johannes Schindelin via GitGitGadget
2024-12-17 20:09 ` Junio C Hamano [this message]
2024-12-18 6:00 ` Patrick Steinhardt
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=xmqqy10eysuz.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=johannes.schindelin@gmx.de \
--cc=ps@pks.im \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).