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

Re: RFD: Handling case-colliding filenames on case-insensitive filesystems

From
Jay Soffian <jaysoffian@gmail.com>
Date
Feb 23, 2011, 19:07 UTC
Message-ID
<AANLkTi=MyqXYi=zNZ+MFcUW2p-_icwg0m_aMQpVioT8J@mail.gmail.com>
In-Reply-To
<201102231811.45948.johan@herland.net>
On Wed, Feb 23, 2011 at 12:11 PM, Johan Herland <johan@herland.net> wrote:
Show 11 quoted lines
> A colleague suggested instead that Git should notice that the collision
> will occur, and work around the failure to represent the repository
> objects in the file system with a one-to-one match. Either by checking
> out only _one_ of the colliding files, or by using a non-colliding name
> for the second file. After all, Git already has functionality for
> manipulating the file contents on checkout (CRLF conversion). Doesn't
> it make sense to add functionality for manipulating the _directory_
> contents on checkout as well? Even if that makes sense, I'm not sure
> that implementing it will be straightforward.
>
> Are there better suggestions on how to deal with this?

The general problem is aliasing in the working-tree, of which case-insenitivity is the most common form, but it also happens due to HFS's use of NFD. A search on gmane for "insensitive" or "nfd" will return many hits.

I think the argument against remapping filenames is that it doesn't really help the user.

Let's say (for the sake of argument) that git supported remapping between the index and the working-tree. Further, my repo has:

$ cat Foo.c #include "Foo.h"

$ cat foo.c #include "foo.h"

And on a case-insensitive file-system, git has remapped foo.[ch] to foo~2.[ch] for the purposes of avoiding collisions on checkout.

The checkout can't be compiled correctly, so what's the point of even allowing it?

(I'm not saying this is right/wrong, just that's been one of the arguments against remapping.)

j.
Previous: Johan HerlandNext: Matthieu Moy
Message 8 of 12 in “RFD: Handling case-colliding filenames on case-insensitive filesystems”
  1. Johan HerlandFeb 23, 2011
  2. Junio C HamanoFeb 23, 2011
  3. Shawn PearceFeb 23, 2011
  4. Junio C HamanoFeb 23, 2011
  5. Johan HerlandFeb 24, 2011
  6. Junio C HamanoFeb 24, 2011
  7. Johan HerlandFeb 24, 2011
  8. Jay SoffianFeb 23, 2011
  9. Matthieu MoyFeb 23, 2011
  10. Marc BranchaudFeb 23, 2011
  11. Greg TroxelFeb 23, 2011
  12. Johan HerlandFeb 24, 2011

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.