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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 23, 2011, 19:27 UTC
Message-ID
<7vfwre8sax.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTi=gAM3LGwU47_EkENerZeKmjwuhWhpHZJGSiW=n@mail.gmail.com>
Shawn Pearce <spearce@spearce.org> writes:
Show 11 quoted lines
> On Wed, Feb 23, 2011 at 10:56, Junio C Hamano <gitster@pobox.com> wrote:
>> Johan Herland <johan@herland.net> writes:
>>
>>> Are there better suggestions on how to deal with this?
>>
>> Just from the top off my head, perhaps you can go to the same route as
>> symbolic link support on filesystems that are not symlink-capable?
>
> I don't know how that helps here Junio. On those systems we write a
> text file holding the symlink contents. That text file name is at
> least still unique in the working directory.

Heh, I probably should have more explicitly hinted that I was suggesting to rename, e.g. foo-1.txt, when checking out conflicting paths. I chose not to be precise because I knew readers were intelligent enough to read what's between my lines themselves ;-).

Just like a text file that records link target is useless as a symlink, such a file would be useless for its original purpose (e.g. renaming xt_TCPMSS.c to xt_tcpmss-1.c to avoid a collision with xt_tcpmss.c would not help when its associated Makefile wants to build xt_TCPMSS.o and xt_tcpmss.o next to each other), just like your "treat everybody the same way and make that a directory" approach.

I think two things are sensible to do, are relatively low hanging fruits, and are of low risk:

 - break checkout on such a tree on incapable filesystems; and
 - per project configuration (or attribute given to paths underneath a
   particular directory) that forbids or warns addition of case colliding
   paths to the index; enforce it at write_index() codepath; and
 - if we choose to just warn in the second item above instead of downright
   forbidding, barf in cache_tree_update() codepath when the per project
   configuration (or attribute) triggers upon case colliding paths, to
   prevent a commit from being made.

I think "warn at add time, fail at write-tree time" is more preferrable, as it might be more convenient if you can add hello.c while you still have HELLO.c in the index as long as you do not forget to remove HELLO.c from the index before making your next commit.

Previous: Shawn PearceNext: Johan Herland
Message 4 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.