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

Re: Bug: Changing folder case with `git mv` crashes on case-insensitive file system

From
Junio C Hamano <gitster@pobox.com>
Date
May 6, 2021, 21:03 UTC
Message-ID
<xmqqlf8ry3qe.fsf@gitster.g>
In-Reply-To
<CAD8jeghZKDcp=weHtcMZ4z8KaO1jQJqfPqaRtYgtiwrX-1+NNg@mail.gmail.com>
Mark Amery <markrobertamery@gmail.com> writes:
Show 13 quoted lines
>   That is: first check the inode or file ID of the src and dst passed
> to `git mv`. If they are different and the second one is a folder,
> move src inside the existing folder. If either they are the same or
> the second one is not a folder, then do a rename.
>
>   It seems to me that this approach automatically handles stuff like
> `git mv bär.txt bÄr.txt` plus any other rules about names being equal
> (like two different sequences of code points that both express "à"),
> all without Git ever needing to explicitly check whether two names are
> case-insensitively equal. Am I missing something?
>
> Sorry if any of the above is dumb or if I'm reiterating things others
> have already said without realising it.

There is nothing dumb about the idea. I think that is essentially what brian and I outlined in the earlier exchange, except that we need to use something other than inum on Windows to decide if two pathnames refer to the same filesystem entity, and the approach we suggested was to use the inum-based check _after_ seeing the current code fail with EINVAL in the error codepath, instead of doing so upfront.

Thanks.
Previous: Torsten Bögershausen
Message 14 of 14 in “Bug: Changing folder case with `git mv` crashes on case-insensitive file system”
  1. Mark AmeryMay 3, 2021
  2. brian m. carlsonMay 3, 2021
  3. Junio C HamanoMay 4, 2021
  4. brian m. carlsonMay 4, 2021
  5. Johannes SchindelinMay 5, 2021
  6. Junio C HamanoMay 6, 2021
  7. Torsten BögershausenMay 4, 2021
  8. Junio C HamanoMay 5, 2021
  9. brian m. carlsonMay 5, 2021
  10. Torsten BögershausenMay 6, 2021
  11. Mark AmeryMay 6, 2021
  12. Bagas SanjayaMay 6, 2021
  13. Torsten BögershausenMay 6, 2021
  14. Junio C HamanoMay 6, 2021

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.