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, 00:38 UTC
Message-ID
<xmqqeeek3de1.fsf@gitster.g>
In-Reply-To
<nycvar.QRO.7.76.6.2105051528030.50@tvgsbejvaqbjf.bet>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 5 quoted lines
> So _if_ we need that file ID information, I would be very much in favor of
> introducing a proper abstraction, where differentiate between the
> intention (think `get_inode(const char *path)`) from the
> platform-dependent implementation detail (think `lstat()`, `CreateFile()`
> and `GetFileInformationByHandle()`).
I agree in principle.  Essentially, we need to
 (1) examine all calls to lstat(2) we make in our codebase, and find
     out what members of "stat" are really used out of the result
     for each callsite.  This will be different from caller to
     caller (some callers may want only ino, other callers may want
     ino, size, and mtime, etc.), and we would learn that there are
     N patterns.
 (2) write N abstracted helper functions (or a single helper that
     takes const char *path, struct stat *, and an enum to tell
     which one of N patterns this call is about).
 (3) replace each lstat(2) call with one of these N abstract helper
     functions.

get_inode() might be one of these N functions, but what is important is that the current callers that want ino and something else should not be penalized by making two separte calls get_inode() and get_other_things(), which, when done naively, would result in two lstat(2) calls.

Previous: Johannes SchindelinNext: Torsten Bögershausen
Message 6 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.