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
Theodore Tso <tytso@mit.edu>
Date
Jan 23, 2008, 02:06 UTC
Message-ID
<20080123020607.GC1320@mit.edu>
In-Reply-To
<E6F76F93-24C9-4D10-813C-770A9C3A9828@sb.org>
On Tue, Jan 22, 2008 at 07:38:04PM -0500, Kevin Ballard wrote:
Show 7 quoted lines
> * Any new characters added to Unicode will only have one form (decomposed), 
> so HFS+ will always accept new characters as they will be NFD. The only 
> exception is case-sensitivity, as the case-folding tables in HFS+ are 
> static, so new characters with case variants will be treated in a 
> case-sensitive manner. However, as they are already decomposed, the NFD 
> algorithm will not change their encoding. This means that no, there are 
> zero problems moving HFS+ drives between versions of OS X.

Except there *are* problems, because this promise doesn't apply to Unicode 2.1 (Mac OS 10.2 and before) and Unicode 3.2 (Mac OS 10.3 and above). And there were changes between the normalization algorithm between Unicode 3.2 and the Unicode version 4.1. So taking a hard drive between Mac OS X 10.2 and 10.3 *will* cause problems. The guarantees of Unicode stability didn't come until well past Unicode 2.1.

Also, I know of no guarantee that there will be no more new compositions. According to Unicode Stnadard Annex #15 (http://unicode.org/reports/tr15/), new characters that can be decomposed are strongly discouraged, but "It would be possible to add more compositions in a future version of Unicode". Got a reference to back up your claim that there will never be any more?

Show 7 quoted lines
> * At the time HFS+ was developed, there was no one common standard for 
> normalization. The HFS+ developers picked NFD because they thought it was 
> "a more flexible, future-looking form", but Microsoft ended up picking the 
> opposite just a short time later. Interestingly, NFC is a weird hybrid form 
> which only has composed forms for pre-existing characters, and decomposed 
> forms for all new characters (as they only have one form). So in a sense 
> NFD is more sane then NFC.

NFC is better if you care about compatibility with existing legacy character sets, where you want round-trip conversions to be idempotent. On the other hand, given that Mac OS has historically never cared about being compatible with the rest of the world, it makes sense that it would choose NFD.

> * The core issue here, which is why you think HFS+ is so stupid, is that 
> you guys see no problem with having 2 files "Märchen" (NFC) and "Märchen" 
> (NFD), whereas the HFS+ developers don't consider it acceptable to have 2 
> visually identical names as independent files.

Yep. No problems to do that. You seem to think that supporting Unicode requires imposing this constraint, but that's simply not true, except maybe in some kind of religious sense.

> Unfortunately, the only way 
> to do this matching is to store the normalized form in the filesystem, 
> because it would be a performance nightmare to try and do this matching any 
> other way.

Nope. They were just not clever enough. If they use a hashed key for their b-tree and used a hash which had the property that two strings that were equivalent in the Unicode sense have the same hash value, it's quite possible to do Unicode-equivalence lookups quickly. Yeah, calculating the hash algorithm takes a bit amount of time, but it gets called no more than the normalization routine, and its performance overhead is no worse than the normalizing a string.

I know how to do it in a Linux filesystem; it's just an insane thing to do, and so I choose not to do it. But it is doable; if you must persue the course of filesystem insanity, it's possible to do it in a performant way, without normalization; it's the same way that you can use b-tree lookups in a case insensitive way.

> I must say it is shocking that someone as smart as you is still more 
> interested in finding ways to prove me wrong then to actually address the 
> problem. It's obvious that the only research you did was intended to find 
> ways to call me stupid.

No, I did the research to try to find the HFS-specific filename mangling algorithm. And given that's based on an back-level, old version of Unicode, you can't just use NFD algorithm from the latest Unicode spec. As I did that research, I came across the evidence that claims you had made (i.e., that HFS had never changed the Unicode version for its Normalization algorithm), was directly contradicted by the Apple TechNote.

    	  					- Ted
Previous: Martin LanghoffNext: David Kastrup
Message 209 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.