Re: [PATCH] mingw: align symlinks-related rmdir() behavior with Linux

2 messages, 2 authors, 2021-08-02 · open the first message on its own page

Re: [PATCH] mingw: align symlinks-related rmdir() behavior with Linux

From: Junio C Hamano <hidden>
Date: 2021-07-29 20:03:16

"Johannes Schindelin via GitGitGadget" [off-list ref]
writes:
From: Johannes Schindelin <redacted>

When performing a rebase, rmdir() is called on the folder .git/logs. On
Unix rmdir() exits without deleting anything in case .git/logs is a
symbolic link but the equivalent functions on Windows (_rmdir, _wrmdir
and RemoveDirectoryW) do not behave the same and remove the folder if it
is symlinked even if it is not empty.
The distinction is understandable, and I can see this justifies the
patch really nicely.

It is curious why "rebase" causes rmdir on the reflog hierarchy,
though.  It is also unclear if "rebase" is special in having this
behaviour (and if so why), or just an example the problem was
observed with and other subcommands may benefit from the same fix.

Will queue with authorship corrected (as you reported in the
follow-up).

Thanks.

Re: [PATCH] mingw: align symlinks-related rmdir() behavior with Linux

From: Johannes Schindelin <hidden>
Date: 2021-08-02 20:17:50

Hi Junio,

On Thu, 29 Jul 2021, Junio C Hamano wrote:
"Johannes Schindelin via GitGitGadget" [off-list ref]
writes:
quoted
From: Johannes Schindelin <redacted>

When performing a rebase, rmdir() is called on the folder .git/logs. On
Unix rmdir() exits without deleting anything in case .git/logs is a
symbolic link but the equivalent functions on Windows (_rmdir, _wrmdir
and RemoveDirectoryW) do not behave the same and remove the folder if it
is symlinked even if it is not empty.
The distinction is understandable, and I can see this justifies the
patch really nicely.

It is curious why "rebase" causes rmdir on the reflog hierarchy,
though.  It is also unclear if "rebase" is special in having this
behaviour (and if so why), or just an example the problem was
observed with and other subcommands may benefit from the same fix.
I augmented the commit message in preparation for v2, specifically to
address this concern.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help