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
Bagas Sanjaya <bagasdotme@gmail.com>
Date
May 6, 2021, 13:11 UTC
Message-ID
<15ba96cb-c682-f6d2-0bc2-eee4094c243c@gmail.com>
In-Reply-To
<CAD8jeghZKDcp=weHtcMZ4z8KaO1jQJqfPqaRtYgtiwrX-1+NNg@mail.gmail.com>
On 06/05/21 16.12, Mark Amery wrote:
Show 16 quoted lines
> • Above, Torsten mentions that there are filesystem-specific rules
> about what names are equal to each other that Git can't easily handle,
> because they go beyond just ASCII case changes. In that case, maybe
> the right solution is to always defer the question to the filesystem
> rather than Git trying to figure out the answer "in its head"?
> 
>    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?

On case when src and dst have different inodes and dst is a file, rather than a directory, mv will overwrite dst with contents of src (on Linux).

-- 
An old man doll... just what I always wanted! - Clara
Previous: Mark AmeryNext: Torsten Bögershausen
Message 12 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.