NFCFS

NFCFS and Git

At the moment of this writing Git does not seem to correctly handle international characters in file names. This might change in the future, the version of Git used in the examples below is 1.6.5.2, if you have a later version, try the example below for yourself to see if it works.

Git without NFCFS

Here's an example of trying to add a file with an international character in the file name to a Git repository:

First, create a repository somewhere:

mkdir /tmp/git
cd /tmp/git
git init

Git should respond with:

Initialized empty Git repository in /private/tmp/git/.git/

Now, create a file with an international character in the file name, and add it to the Git repo:

touch ö.txt
git add ö.git

So far so good, but when asking Git for status using

git status

Git will respond with

# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add ..." to include in what will be committed)
#
#	"o\314\210.txt"
nothing added to commit but untracked files present (use "git add" to track)

This is not correct, Git has not added the file to the reposiotry as expected. Note the file name Git is reporting: o\314\210.txt. The ASCII character o followed by bytes 314 and 210 is a valid UTF-8 representation of the character ö, it is the letter o followed by Unicode character COMBINING DIARESIS (U+0308). This is the character ö in decomposed form, which is correct, but not what Git expects.

If I try to commit using

git commit -m "whatever"

Git will respond with

# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add ..." to include in what will be committed)
#
#	"o\314\210.txt"
nothing added to commit but untracked files present (use "git add" to track)

failing to commit my new file.

Git with NFCFS

Doing the same thing in a directory mounted using NFCFS works slightly better:

First, create the repository and add the file as above:

mkdir /Volumes/nfcfs/git
cd /Volumes/nfcfs/git
git init
touch ö.txt
git add ö.git

When asking for status using

git status

Git will respond with

# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached ..." to unstage)
#
#	new file:   "\303\266.txt"
#

The file name is not very readable, but the behaviour seems to be correct. The byte sequence 303, 206 is UTF-8 encoding of the Unicode character LATIN SMALL LETTER O WITH DIAERESIS (U+00F6), the letter ö.

Committing using

git commit -m "whatever"

will result in

[master (root-commit) 9d906e0] whatever
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 "\303\266.txt"

putting the file under version control as expected.