Re: [PATCH/RFC] core.precomposeunicode is true by default
- From
Torsten Bögershausen <tboegi@web.de>
- Date
- Aug 27, 2013, 15:06 UTC
- Message-ID
- <521CC07B.4000504@web.de>
- In-Reply-To
- <xmqqvc2rfau9.fsf@gitster.dls.corp.google.com>
On 27.08.13 16:49, Junio C Hamano wrote:
Show 28 quoted lines
> Torsten Bögershausen <tboegi@web.de> writes: > >>> ... see if that path can be seen under its alias. Why do we set it >>> to "false"? Isn't this the true culprit? >>> >>> After all, this is not in the "reinit" codepath, so we know we are >>> dealing with a repository that was created afresh. >> There is nothing wrong with the auto-sensing as such. >> The problem for many users today is that we set core.precomposeunicode >> to false, when it should be true. > I think we are in agreement then. > > The code detects a broken filesystem just fine, but what it does > when it finds the filesystem is broken is wrong---it sets the > variable to false. That makes the whole auto-sensing wrong, and I > think it makes sense to correct that behaviour. > >> Let's look what precomposed_unicode does and go through a couple >> of git operations. >> >> 1) >> When we create a repo under Mac OS using HFS+, >> we want to have precomposed_unicode = 1 > Yes. > >> 2) >> When we access a repo from Windows/Linux using SAMBA, > You mean s/repo/repository that resides on HFS+/?
Sorry being unclear here, trying being clearer with an example: I have a /data/Docs on my linux box, which is handled by git
I export /data/Docs via SAMBA, and use the Finder under Mac OS to have it mounted on my Mac OS X box: //tb@Linux/Docs on /Volumes/Docs (smbfs, nodev, nosuid, mounted by tb)
Show 6 quoted lines
>> readdir() will return decomposed. >> When the repo is created by nonMacOS, core.precomposeunicode is undefined. >> The precomposition is off, but should be on, >> precomposed_unicode = -1, but should be = 1 > I do not think UTF-8-MAC is widely available; even if you flip the > bit on, would it help much?
In the above example /data/Docs/.git/config was created by Linux, so it does not have core.precomposeunicode set, neither false nor true. The Linux box does not have UTF-8-MAC under iconv, but will ignore core.precomposeunicode anyway (since the code is not compiled here)
The Mac OS machine sees it under /Volumes/Docs/.git/config And here we want the precomposition, even if core.precomposeunicode is not present in the config.