On Fri Nov 22 14:39:52 2024 +0000, Gabriel Ivăncescu wrote:
Thanks for the review, I had forgotten about this (well, with year end I'd probably look through my stuff again). Good point. Note that `different_case` should be 1 only when the case is different on the name, but the "name" here is always the destination. The "source" is just a fd. Maybe this is not clear, I should add a comment. So for your question, the behavior is the same as before, because you have a fd to `foo.txt` and then you want to rename it to `bar.txt` (which is already a hardlink to the same file), but in this case the "name" and "case" are the same, both are `bar.txt` so `different_case = 0`. However, if we were to rename it to `Bar.txt` (while `bar.txt` already exists, lowercase), then `different_case = 1`. In this case we'd try to rename `foo.txt` to `Bar.txt`. This is… bad I guess, because now we'd have both `Bar.txt` and `bar.txt` in the same directory (but both are hardlinks to the same file). Any idea how to **detect** this? And apply appropriate fix (depending what happens on Windows).
Thanks for the explanation.
However, if we were to rename it to `Bar.txt` (while `bar.txt` already exists, lowercase), then `different_case = 1`. In this case we'd try to rename `foo.txt` to `Bar.txt`.
This is… bad I guess, because now we'd have both `Bar.txt` and `bar.txt` in the same directory (but both are hardlinks to the same file).
Any idea how to **detect** this? And apply appropriate fix (depending what happens on Windows).
Hopefully we can continue this discussion on !6855, when I find time.
Nevertheless, I don't consider this blocking if the existing behavior is already broken.