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

Re: Git an case-insensitive Mac OS X filesystem

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Sep 11, 2012, 10:28 UTC
Message-ID
<vpq392og8fg.fsf@bauges.imag.fr>
In-Reply-To
<CABPQNSYv1hd8RFHfcQ1XTB94nu6xo+tjj4CvWur29152z2dk6A@mail.gmail.com>
Erik Faye-Lund <kusmabite@gmail.com> writes:
> I have stumbled upon a similar issue on Windows (which also has a
> case-preserving filesystem), and I seem to remember the solution being
> something to do with packed refs.
Packed-refs use a format like this:

$ tail -3 .git/packed-refs e94214ce4b8acefce06d4ea37b76ac0de11ecb2d refs/tags/v1.7.9.5 bf68fe0313c833fa62755176f6e24988ef7cf80f refs/tags/v1.7.9.6 3996bb24c84013ec9ce9fa0980ce61f9ef97be4d refs/tags/v1.7.9.7

so the ref name is stored within the file, not as the file name. So, yes, packing refs (done by "git pack-refs", called by "git gc" among other things) should solve case-insensitive issues.

However, creating or updating refs after a pack will still create unpacked refs, so this solves the issue only if one of the colliding branches is not updated anymore.

> Perhaps we could change Git to detect name-collisions and
> automatically pack the refs in such cases?

That's a bit harder than it seems, as the idea is to avoid re-writting the packed-refs file for each ref update. Repacking after each colliding ref update could be costly in terms of performance.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Erik Faye-LundNext: Erik Faye-Lund
Message 3 of 10 in “Git an case-insensitive Mac OS X filesystem”
  1. Roger Pau MonnéSep 11, 2012
  2. Erik Faye-LundSep 11, 2012
  3. Matthieu MoySep 11, 2012
  4. Erik Faye-LundSep 11, 2012
  5. Matthieu MoySep 11, 2012
  6. Junio C HamanoSep 11, 2012
  7. Roger Pau MonnéSep 11, 2012
  8. Tomas CarneckySep 11, 2012
  9. Roger Pau MonnéSep 11, 2012
  10. Junio C HamanoSep 11, 2012

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.