1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-07 09:43:00 +01:00
git/Documentation
Torsten Bögershausen 76759c7dff git on Mac OS and precomposed unicode
Mac OS X mangles file names containing unicode on file systems HFS+,
VFAT or SAMBA.  When a file using unicode code points outside ASCII
is created on a HFS+ drive, the file name is converted into
decomposed unicode and written to disk. No conversion is done if
the file name is already decomposed unicode.

Calling open("\xc3\x84", ...) with a precomposed "Ä" yields the same
result as open("\x41\xcc\x88",...) with a decomposed "Ä".

As a consequence, readdir() returns the file names in decomposed
unicode, even if the user expects precomposed unicode.  Unlike on
HFS+, Mac OS X stores files on a VFAT drive (e.g. an USB drive) in
precomposed unicode, but readdir() still returns file names in
decomposed unicode.  When a git repository is stored on a network
share using SAMBA, file names are send over the wire and written to
disk on the remote system in precomposed unicode, but Mac OS X
readdir() returns decomposed unicode to be compatible with its
behaviour on HFS+ and VFAT.

The unicode decomposition causes many problems:

- The names "git add" and other commands get from the end user may
  often be precomposed form (the decomposed form is not easily input
  from the keyboard), but when the commands read from the filesystem
  to see what it is going to update the index with already is on the
  filesystem, readdir() will give decomposed form, which is different.

- Similarly "git log", "git mv" and all other commands that need to
  compare pathnames found on the command line (often but not always
  precomposed form; a command line input resulting from globbing may
  be in decomposed) with pathnames found in the tree objects (should
  be precomposed form to be compatible with other systems and for
  consistency in general).

- The same for names stored in the index, which should be
  precomposed, that may need to be compared with the names read from
  readdir().

NFS mounted from Linux is fully transparent and does not suffer from
the above.

As Mac OS X treats precomposed and decomposed file names as equal,
we can

 - wrap readdir() on Mac OS X to return the precomposed form, and

 - normalize decomposed form given from the command line also to the
   precomposed form,

to ensure that all pathnames used in Git are always in the
precomposed form.  This behaviour can be requested by setting
"core.precomposedunicode" configuration variable to true.

The code in compat/precomposed_utf8.c implements basically 4 new
functions: precomposed_utf8_opendir(), precomposed_utf8_readdir(),
precomposed_utf8_closedir() and precompose_argv().  The first three
are to wrap opendir(3), readdir(3), and closedir(3) functions.

The argv[] conversion allows to use the TAB filename completion done
by the shell on command line.  It tolerates other tools which use
readdir() to feed decomposed file names into git.

When creating a new git repository with "git init" or "git clone",
"core.precomposedunicode" will be set "false".

The user needs to activate this feature manually.  She typically
sets core.precomposedunicode to "true" on HFS and VFAT, or file
systems mounted via SAMBA.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-08 22:03:46 -07:00
..
howto correct spelling: an URL -> a URL 2012-03-28 08:47:23 -07:00
pt_BR
RelNotes Git 1.7.11 2012-06-17 14:07:15 -07:00
technical Merge branch 'mm/api-credentials-doc' 2012-06-12 08:40:16 -07:00
.gitattributes
.gitignore
asciidoc.conf docs: fix cross-directory linkgit references 2012-06-08 08:31:52 -07:00
blame-options.txt
build-docdep.perl
cat-texi.perl
cmd-list.perl
CodingGuidelines CodingGuidelines: do not use 'which' in shell scripts 2012-02-27 15:10:23 -08:00
config.txt git on Mac OS and precomposed unicode 2012-07-08 22:03:46 -07:00
date-formats.txt
diff-config.txt diff --stat: add config option to limit graph width 2012-03-01 09:15:58 -08:00
diff-format.txt
diff-generate-patch.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
diff-options.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
docbook-xsl.css
docbook.xsl
everyday.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
fetch-options.txt
fix-texi.perl
git-add.txt
git-am.txt Merge branch 'jb/am-include' 2012-04-20 15:49:16 -07:00
git-annotate.txt
git-apply.txt
git-archimport.txt
git-archive.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-bisect-lk2009.txt
git-bisect.txt
git-blame.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-branch.txt Merge branch 'nd/columns' 2012-05-03 15:13:31 -07:00
git-bundle.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-cat-file.txt
git-check-attr.txt
git-check-ref-format.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-checkout-index.txt
git-checkout.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-cherry-pick.txt Merge branch 'jk/doc-asciidoc-inline-literal' 2012-05-02 13:51:45 -07:00
git-cherry.txt
git-citool.txt
git-clean.txt
git-clone.txt clone: allow --branch to take a tag 2012-01-16 16:26:26 -08:00
git-column.txt Add column layout skeleton and git-column 2012-04-27 09:26:37 -07:00
git-commit-tree.txt ident: report passwd errors with a more friendly message 2012-05-22 09:08:20 -07:00
git-commit.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-config.txt config doc: remove confusion about relative GIT_DIR from FILES section 2012-05-25 11:22:02 -07:00
git-count-objects.txt
git-credential-cache--daemon.txt
git-credential-cache.txt
git-credential-store.txt
git-cvsexportcommit.txt
git-cvsimport.txt
git-cvsserver.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-daemon.txt
git-describe.txt
git-diff-files.txt
git-diff-index.txt
git-diff-tree.txt
git-diff.txt
git-difftool.txt difftool: print list of valid tools with '--tool-help' 2012-04-23 12:00:42 -07:00
git-fast-export.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-fast-import.txt Merge branch 'jk/doc-asciidoc-inline-literal' 2012-05-02 13:51:45 -07:00
git-fetch-pack.txt fetch-pack: new --stdin option to read refs from stdin 2012-04-02 13:47:15 -07:00
git-fetch.txt
git-filter-branch.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-fmt-merge-msg.txt Document merge.branchdesc configuration variable 2012-02-23 11:20:15 -08:00
git-for-each-ref.txt
git-format-patch.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-fsck-objects.txt
git-fsck.txt fsck doc: a minor typofix 2012-03-05 11:32:19 -08:00
git-gc.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-get-tar-commit-id.txt
git-grep.txt Merge branch 'rs/maint-grep-F' into maint 2012-06-01 13:01:41 -07:00
git-gui.txt
git-hash-object.txt
git-help.txt
git-http-backend.txt
git-http-fetch.txt
git-http-push.txt
git-imap-send.txt
git-index-pack.txt index-pack: support multithreaded delta resolving 2012-05-07 15:48:15 -07:00
git-init-db.txt
git-init.txt
git-instaweb.txt
git-log.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-lost-found.txt
git-ls-files.txt
git-ls-remote.txt
git-ls-tree.txt
git-mailinfo.txt Merge branch 'tr/maint-mailinfo' 2012-01-12 23:34:26 -08:00
git-mailsplit.txt
git-merge-base.txt
git-merge-file.txt
git-merge-index.txt
git-merge-one-file.txt
git-merge-tree.txt
git-merge.txt merge: use editor by default in interactive sessions 2012-01-23 14:34:55 -08:00
git-mergetool--lib.txt
git-mergetool.txt
git-mktag.txt
git-mktree.txt
git-mv.txt
git-name-rev.txt
git-notes.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-p4.txt Sync with maint 2012-05-07 13:28:34 -07:00
git-pack-objects.txt
git-pack-redundant.txt
git-pack-refs.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-parse-remote.txt
git-patch-id.txt
git-peek-remote.txt
git-prune-packed.txt
git-prune.txt
git-pull.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-push.txt Merge branch 'jk/doc-asciidoc-inline-literal' 2012-05-02 13:51:45 -07:00
git-quiltimport.txt
git-read-tree.txt Merge branch 'jh/fetch-head-update' 2012-01-06 12:44:01 -08:00
git-rebase.txt Merge branch 'jk/doc-asciidoc-inline-literal' 2012-05-02 13:51:45 -07:00
git-receive-pack.txt
git-reflog.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-relink.txt
git-remote-ext.txt
git-remote-fd.txt
git-remote-helpers.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-remote-testgit.txt
git-remote.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-repack.txt fsck: --no-dangling omits "dangling object" information 2012-02-28 14:55:39 -08:00
git-replace.txt
git-repo-config.txt
git-request-pull.txt
git-rerere.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-reset.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-rev-list.txt
git-rev-parse.txt Merge branch 'js/rev-parse-doc-fix' 2012-05-23 13:35:19 -07:00
git-revert.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-rm.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-send-email.txt send-email: document the --smtp-debug option 2012-02-27 10:29:24 -08:00
git-send-pack.txt
git-sh-i18n--envsubst.txt correct a few doubled-word nits in comments and documentation 2012-03-28 11:18:35 -07:00
git-sh-i18n.txt
git-sh-setup.txt
git-shell.txt
git-shortlog.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-show-branch.txt
git-show-index.txt
git-show-ref.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-show.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-stage.txt
git-stash.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-status.txt Merge branch 'jk/maint-status-porcelain-z-b' into maint 2012-05-24 17:32:30 -07:00
git-stripspace.txt
git-submodule.txt link to gitmodules page at the beginning of git-submodule documentation 2012-05-14 11:14:07 -07:00
git-svn.txt git-svn: clarify the referent of dcommit's optional argument 2012-05-17 09:35:18 +00:00
git-symbolic-ref.txt symbolic-ref --short: abbreviate the output unambiguously 2012-02-27 15:58:36 -08:00
git-tag.txt tag: add --column 2012-04-27 09:26:39 -07:00
git-tar-tree.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-tools.txt
git-unpack-file.txt
git-unpack-objects.txt
git-update-index.txt update-index: upgrade/downgrade on-disk index version 2012-04-04 09:57:50 -07:00
git-update-ref.txt
git-update-server-info.txt
git-upload-archive.txt
git-upload-pack.txt
git-var.txt ident: report passwd errors with a more friendly message 2012-05-22 09:08:20 -07:00
git-verify-pack.txt
git-verify-tag.txt
git-web--browse.txt
git-whatchanged.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
git-write-tree.txt
git.txt Git 1.7.11 2012-06-17 14:07:15 -07:00
gitattributes.txt Add a setting to require a filter to be successful 2012-02-17 07:37:08 -08:00
gitcli.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
gitcore-tutorial.txt Merge branch 'zj/diff-stat-smaller-num-columns' 2012-05-02 13:53:28 -07:00
gitcredentials.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
gitcvs-migration.txt
gitdiffcore.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
gitglossary.txt
githooks.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
gitignore.txt
gitk.txt
gitmodules.txt document submdule.$name.update=none option for gitmodules 2012-05-11 08:39:33 -07:00
gitnamespaces.txt
gitrepository-layout.txt
gitrevisions.txt
gittutorial-2.txt Use correct grammar in diffstat summary line 2012-02-03 23:19:42 -08:00
gittutorial.txt
gitweb.conf.txt Merge branch 'jk/doc-asciidoc-inline-literal' 2012-05-02 13:51:45 -07:00
gitweb.txt Documentation/gitweb: trivial English fixes 2012-03-23 11:22:04 -07:00
gitworkflows.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
glossary-content.txt
howto-index.sh
i18n.txt
install-doc-quick.sh
install-webdoc.sh
mailmap.txt
Makefile Merge branch 'mm/api-credentials-doc' 2012-06-08 08:32:20 -07:00
manpage-1.72.xsl
manpage-base-url.xsl.in
manpage-base.xsl
manpage-bold-literal.xsl
manpage-normal.xsl
manpage-quote-apos.xsl
manpage-suppress-sp.xsl
merge-config.txt
merge-options.txt merge: backport GIT_MERGE_AUTOEDIT support 2012-03-20 15:39:10 -07:00
merge-strategies.txt
pretty-formats.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
pretty-options.txt
pull-fetch-param.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
rev-list-options.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00
revisions.txt Documentation: do not assume that n > 1 in <rev>~$n 2012-03-02 09:33:29 -08:00
sequencer.txt
SubmittingPatches
urls-remotes.txt
urls.txt
user-manual.conf
user-manual.txt docs: stop using asciidoc no-inline-literal 2012-04-26 13:19:06 -07:00