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

Re: git on MacOSX and files with decomposed utf-8 file names

From
Kevin Ballard <kevin@sb.org>
Date
Jan 17, 2008, 04:30 UTC
Message-ID
<4C21C1AF-40B0-48C7-8F0E-2DAF3C5FAB29@sb.org>
In-Reply-To
<alpine.LFD.1.00.0801161959210.2806@woody.linux-foundation.org>
On Jan 16, 2008, at 11:08 PM, Linus Torvalds wrote:
Show 17 quoted lines
> On Wed, 16 Jan 2008, Kevin Ballard wrote:
>>
>> I believe it exists because HFS+ was created at a time when the Mac  
>> was moving
>> from a multi-encoding world (which was a nightmare) to a Unicode  
>> world and
>> they wanted to remove ambiguity in filenames. But I wasn't around  
>> when they
>> made this decision so this is just a guess.
>
> I do agree. And I think starting out case-insensitive (something  
> they must
> really hate by now) also made it less of an issue. When you're
> case-insensitive, the issues with any UTF-8 normalization are simply
> swamped by all the issues of case, so you probably don't even think  
> about
> it very much.

Those of us who grew up on a case-insensitive filesystem don't find there to be any problem with it. I can count on one hand the number of times I've run into a problem caused by a case-insensitive filesystem. That number is 1. And that 1 time is when git screwed up trying to track CS4536 and cs4536 in the same directory (see earlier thread).

Show 6 quoted lines
> The big problem with any name rewriting is that I can open file  
> 'xyz', and
> I literally have a very hard time knowing whether that file I know I
> opened and created has anything to do with the file 'Xyz' that I see  
> when
> I do a readdir().

That's only true if you don't know what type of filesystem you're on. And, in the vast majority of cases (in fact, a content tracker is the only exception I can think of), it doesn't matter. If the user said 'xyz' and you can stat() it, great, that's what the user wanted! Just because it's really called 'Xyz' on the filesystem doesn't make any difference.

Show 17 quoted lines
> Are they the same? Maybe. But it's literally hard to tell on OS X. I  
> can
> do an fstat() on my file descriptor and on the directory entry, and if
> they get the same d_ino they *probably are the same entry, but even  
> then
> it actually could have been a hardlink (and my 'xyz' is really  
> *another*
> name for it entirely, and the filesystem is actually case-sensitive  
> and
> 'Xyz' was a *different* name that somebody else did!).
>
> See? If you're creating a content tracker, these kinds of issues are  
> not
> "idle chatter". It's really *really* important. Was that file the  
> one I
> was told to track? Or was it a temporary file that was just  
> hardlinked?

But git is a content tracker, so even if it's really a different hardlink that shouldn't matter, it's still referencing the same content. Go ahead and track whatever name the user specified originally, as long as it maps to a file on disk with the expected content you're set. If the file is really called 'foo' and I told git to track 'Foo', I'm perfectly happy with it continuing to think 'foo' is 'Foo' until I use 'git mv Foo foo'.

Show 5 quoted lines
> This is why case-insensitivity is so hard: you have a very real  
> "aliasing"
> on the filesystem level, where all those really *different*  
> pathnames end
> up being the same thing.

I don't see that as being a problem. Think of it, if you will, as if every single file simply had an implicit hardlink for every possible case or normalization variant. The whole point of the filename is that it is meta-information, used as an identifier and not as actual content, and thus it is perfectly fine for it to be a real string, subject to interpretation, rather than treated as a sacred binary blob like content is. The whole purpose of the name is to identify the inode in question, and case and normalization aren't particularly relevant here. As long as we can identify the file, we're happy.

Show 16 quoted lines
> And all the same issues show up with utf-8 rewriting, so if you  
> normalize
> utf-8 names, you actually end up having almost all the same problems  
> that
> a case-insensitive filesystem has. They're just much rarer in  
> practice, so
> you just won't hit them as often - but when you do, they are equally
> painful!
>
> (In fact, they can be a whole lot *more* painful, because now they are
> really rare, and really confusing when they happen!)
>
> But if you come from a case-insensitive background, all the UTF-8
> rewriting really looks like such a small problem compared to all the
> horrid problems that you had with different locales and cases, so I
> suspect they didn't even realize what a big mistake they did!

Again, as someone who grew up in a case-insensitive world, there's no problems here. I wish I could tell you that it causes problems, I wish I could agree with you, but I can't.

-Kevin Ballard
-- 
Kevin Ballard
http://kevin.sb.org
kevin@sb.org
http://www.tildesoft.com
Previous: Linus TorvaldsNext: Martin Langhoff
Message 39 of 260 in “git on MacOSX and files with decomposed utf-8 file names”
  1. Mark JunkerJan 16, 2008
  2. Johannes SchindelinJan 16, 2008
  3. Kevin BallardJan 16, 2008
  4. Johannes SchindelinJan 16, 2008
  5. Jakub NarebskiJan 16, 2008
  6. Kevin BallardJan 16, 2008
  7. Jakub NarebskiJan 16, 2008
  8. Kevin BallardJan 16, 2008
  9. Johannes SchindelinJan 16, 2008
  10. Kevin BallardJan 16, 2008
  11. Linus TorvaldsJan 16, 2008
  12. Linus TorvaldsJan 16, 2008
  13. Kevin BallardJan 16, 2008
  14. Linus TorvaldsJan 16, 2008
  15. Pedro MeloJan 16, 2008
  16. Linus TorvaldsJan 17, 2008
  17. Pedro MeloJan 17, 2008
  18. David KastrupJan 17, 2008
  19. Pedro MeloJan 17, 2008
  20. Wincent ColaiutaJan 17, 2008
  21. Johannes SchindelinJan 17, 2008
  22. Linus TorvaldsJan 17, 2008
  23. Kevin BallardJan 17, 2008
  24. Johannes SchindelinJan 17, 2008
  25. Pedro MeloJan 17, 2008
  26. Peter KarlssonJan 18, 2008
  27. Jakub NarebskiJan 18, 2008
  28. David KastrupJan 16, 2008
  29. Linus TorvaldsJan 17, 2008
  30. Kevin BallardJan 17, 2008
  31. Linus TorvaldsJan 17, 2008
  32. Johannes SchindelinJan 17, 2008
  33. Pedro MeloJan 17, 2008
  34. Johannes SchindelinJan 17, 2008
  35. Linus TorvaldsJan 17, 2008
  36. Linus TorvaldsJan 17, 2008
  37. Kevin BallardJan 17, 2008
  38. Linus TorvaldsJan 17, 2008
  39. Kevin BallardJan 17, 2008
  40. Martin LanghoffJan 17, 2008
  41. Kevin BallardJan 17, 2008
  42. Geert BoschJan 17, 2008
  43. Mitch TishmackJan 17, 2008
  44. Wincent ColaiutaJan 17, 2008
  45. Kevin BallardJan 17, 2008
  46. Johannes SchindelinJan 17, 2008
  47. Kevin BallardJan 17, 2008
  48. Robin RosenbergJan 18, 2008
  49. Andrew HeybeyJan 17, 2008
  50. Kevin BallardJan 17, 2008
  51. Kyle MoffettJan 19, 2008
  52. Kevin BallardJan 19, 2008
  53. Wincent ColaiutaJan 17, 2008
  54. Linus TorvaldsJan 17, 2008
  55. Mark JunkerJan 17, 2008
  56. Pedro MeloJan 17, 2008
  57. Johannes SchindelinJan 17, 2008
  58. Mark JunkerJan 17, 2008
  59. Pedro MeloJan 17, 2008
  60. Linus TorvaldsJan 17, 2008
  61. Pedro MeloJan 17, 2008
  62. Linus TorvaldsJan 17, 2008
  63. Mark JunkerJan 17, 2008
  64. Pedro MeloJan 17, 2008
  65. Theodore TsoJan 17, 2008
  66. Linus TorvaldsJan 17, 2008
  67. Kevin BallardJan 18, 2008
  68. Linus TorvaldsJan 18, 2008
  69. Robin RosenbergJan 18, 2008
  70. Linus TorvaldsJan 18, 2008
  71. Brian DessentJan 18, 2008
  72. Dmitry PotapovJan 18, 2008
  73. Robin RosenbergJan 18, 2008
  74. Dmitry PotapovJan 18, 2008
  75. Peter KarlssonJan 18, 2008
  76. Jakub NarebskiJan 18, 2008
  77. Peter KarlssonJan 18, 2008
  78. Dmitry PotapovJan 18, 2008
  79. Peter KarlssonJan 18, 2008
  80. Linus TorvaldsJan 18, 2008
  81. Kevin BallardJan 18, 2008
  82. Dmitry PotapovJan 19, 2008
  83. Kevin BallardJan 19, 2008
  84. Dmitry PotapovJan 19, 2008
  85. Linus TorvaldsJan 19, 2008
  86. Mark JunkerJan 19, 2008
  87. Johannes SchindelinJan 19, 2008
  88. Dmitry PotapovJan 20, 2008
  89. Linus TorvaldsJan 20, 2008
  90. Johannes SchindelinJan 20, 2008
  91. Wincent ColaiutaJan 20, 2008
  92. Linus TorvaldsJan 20, 2008
  93. Mike HommeyJan 20, 2008
  94. Linus TorvaldsJan 20, 2008
  95. Mike HommeyJan 20, 2008
  96. Linus TorvaldsJan 20, 2008
  97. Dmitry PotapovJan 20, 2008
  98. Dmitry PotapovJan 20, 2008
  99. Wincent ColaiutaJan 20, 2008
  100. Junio C HamanoJan 18, 2008
  101. Johannes SchindelinJan 18, 2008
  102. Eric W. BiedermanJan 23, 2008
  103. Junio C HamanoJan 23, 2008
  104. Nicolas PitreJan 23, 2008
  105. Junio C HamanoJan 23, 2008
  106. Peter KarlssonJan 21, 2008
  107. Kevin BallardJan 21, 2008
  108. David KastrupJan 21, 2008
  109. Kevin BallardJan 21, 2008
  110. Dmitry PotapovJan 21, 2008
  111. Kevin BallardJan 21, 2008
  112. David KastrupJan 21, 2008
  113. Dmitry PotapovJan 21, 2008
  114. Jeff KingJan 21, 2008
  115. Nicolas PitreJan 21, 2008
  116. Kevin BallardJan 21, 2008
  117. David KastrupJan 21, 2008
  118. David KastrupJan 21, 2008
  119. Linus TorvaldsJan 21, 2008
  120. Kevin BallardJan 21, 2008
  121. Linus TorvaldsJan 21, 2008
  122. Kevin BallardJan 21, 2008
  123. Linus TorvaldsJan 21, 2008
  124. Kevin BallardJan 21, 2008
  125. David KastrupJan 21, 2008
  126. Martin LanghoffJan 21, 2008
  127. Kevin BallardJan 21, 2008
  128. Martin LanghoffJan 21, 2008
  129. Linus TorvaldsJan 21, 2008
  130. Kevin BallardJan 21, 2008
  131. Linus TorvaldsJan 21, 2008
  132. Kevin BallardJan 21, 2008
  133. Martin LanghoffJan 21, 2008
  134. Theodore TsoJan 21, 2008
  135. Kevin BallardJan 21, 2008
  136. Linus TorvaldsJan 21, 2008
  137. Kevin BallardJan 22, 2008
  138. Linus TorvaldsJan 22, 2008
  139. Linus TorvaldsJan 22, 2008
  140. Kevin BallardJan 22, 2008
  141. Linus TorvaldsJan 22, 2008
  142. Kevin BallardJan 22, 2008
  143. Linus TorvaldsJan 22, 2008
  144. Martin LanghoffJan 22, 2008
  145. Kevin BallardJan 22, 2008
  146. Theodore TsoJan 21, 2008
  147. Kevin BallardJan 21, 2008
  148. Theodore TsoJan 21, 2008
  149. Kevin BallardJan 21, 2008
  150. Theodore TsoJan 21, 2008
  151. Kevin BallardJan 21, 2008
  152. Dmitry PotapovJan 21, 2008
  153. Kevin BallardJan 21, 2008
  154. Dmitry PotapovJan 21, 2008
  155. Kevin BallardJan 21, 2008
  156. Dmitry PotapovJan 21, 2008
  157. Mike HommeyJan 21, 2008
  158. Dmitry PotapovJan 21, 2008
  159. Martin LanghoffJan 21, 2008
  160. David KastrupJan 21, 2008
  161. Linus TorvaldsJan 21, 2008
  162. Martin LanghoffJan 21, 2008
  163. Dmitry PotapovJan 21, 2008
  164. Linus TorvaldsJan 21, 2008
  165. Dmitry PotapovJan 17, 2008
  166. JM IbanezJan 17, 2008
  167. Johannes SchindelinJan 17, 2008
  168. Robin RosenbergJan 18, 2008
  169. Linus TorvaldsJan 17, 2008
  170. Dmitry PotapovJan 17, 2008
  171. Dmitry PotapovJan 16, 2008
  172. Eyvind BernhardsenJan 16, 2008
  173. Wincent ColaiutaJan 16, 2008
  174. Miles BaderJan 17, 2008
  175. Jay SoffianJan 17, 2008
  176. Jay SoffianJan 17, 2008
  177. Junio C HamanoJan 17, 2008
  178. Wincent ColaiutaJan 17, 2008
  179. Johannes SchindelinJan 17, 2008
  180. Pedro MeloJan 17, 2008
  181. Wincent ColaiutaJan 17, 2008
  182. Johannes SchindelinJan 17, 2008
  183. Wincent ColaiutaJan 17, 2008
  184. Junio C HamanoJan 17, 2008
  185. Johan HerlandJan 17, 2008
  186. Johannes SchindelinJan 17, 2008
  187. Wincent ColaiutaJan 17, 2008
  188. Linus TorvaldsJan 17, 2008
  189. Theodore TsoJan 21, 2008
  190. Kevin BallardJan 21, 2008
  191. Martin LanghoffJan 21, 2008
  192. Kevin BallardJan 21, 2008
  193. Johannes SchindelinJan 22, 2008
  194. Kevin BallardJan 22, 2008
  195. David KastrupJan 22, 2008
  196. Martin LanghoffJan 22, 2008
  197. Johannes SchindelinJan 22, 2008
  198. Martin LanghoffJan 22, 2008
  199. Johannes SchindelinJan 22, 2008
  200. David KastrupJan 21, 2008
  201. Kevin BallardJan 22, 2008
  202. David KastrupJan 22, 2008
  203. Kevin BallardJan 21, 2008
  204. Martin LanghoffJan 21, 2008
  205. Kevin BallardJan 22, 2008
  206. Theodore TsoJan 23, 2008
  207. Kevin BallardJan 23, 2008
  208. Martin LanghoffJan 23, 2008
  209. Theodore TsoJan 23, 2008
  210. David KastrupJan 23, 2008
  211. Linus TorvaldsJan 23, 2008
  212. Martin LanghoffJan 23, 2008
  213. Kevin BallardJan 23, 2008
  214. Martin LanghoffJan 23, 2008
  215. Theodore TsoJan 23, 2008
  216. Linus TorvaldsJan 23, 2008
  217. Kevin BallardJan 23, 2008
  218. Mike HommeyJan 23, 2008
  219. Kevin BallardJan 23, 2008
  220. Dmitry PotapovJan 23, 2008
  221. Jonathan del StrotherJan 23, 2008
  222. Dmitry PotapovJan 23, 2008
  223. Mike HommeyJan 23, 2008
  224. Dmitry PotapovJan 23, 2008
  225. Mike HommeyJan 23, 2008
  226. Theodore TsoJan 23, 2008
  227. Linus TorvaldsJan 23, 2008
  228. Theodore TsoJan 23, 2008
  229. Kevin BallardJan 23, 2008
  230. Linus TorvaldsJan 23, 2008
  231. On pathnamesJunio C Hamano, Jan 24, 2008
  232. Nicolas PitreJan 24, 2008
  233. Martin LanghoffJan 25, 2008
  234. Junio C HamanoJan 25, 2008
  235. Junio C HamanoJan 25, 2008
  236. Pedro MeloJan 25, 2008
  237. Johannes SchindelinJan 25, 2008
  238. David KastrupJan 25, 2008
  239. Wincent ColaiutaJan 25, 2008
  240. SeanJan 24, 2008
  241. Johannes SchindelinJan 25, 2008
  242. Daniel BarkalowJan 25, 2008
  243. Junio C HamanoJan 25, 2008
  244. Johannes SchindelinJan 25, 2008
  245. Daniel BarkalowJan 25, 2008
  246. Johannes SchindelinJan 25, 2008
  247. Jeff KingJan 25, 2008
  248. Jay SoffianJan 23, 2008
  249. Martin LanghoffJan 23, 2008
  250. Kevin BallardJan 23, 2008
  251. Dmitry PotapovJan 23, 2008
  252. Kevin BallardJan 23, 2008
  253. Kevin BallardJan 24, 2008
  254. Junio C HamanoJan 24, 2008
  255. Martin LanghoffJan 24, 2008
  256. Kevin BallardJan 24, 2008
  257. Steffen ProhaskaJan 24, 2008
  258. Mitch TishmackJan 24, 2008
  259. Mitch TishmackJan 24, 2008
  260. Kevin BallardJan 24, 2008

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.