Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

[RFC] File system difference handling in git

From: Reece Dunn <hidden>
Date: 2016-06-15 22:44:07

Hi,

Observing the various comments w.r.t. the different (potentially
braindead) filesystems that are available, there are two general
categories for behavioural differences:

  1.  File name representation

For Linux file systems (correct me if I am wrong here), they all store
the file name as-is. The question here is what happens on
Windows-based file systems (e.g. NTFS) that are being read on Linux?

For Mac filesystems, you have the Unicode character decomposition
issues to deal with.

For Windows, you have UTF-16 filename support.

There are two basic usages for file/directory names: passing the name
to the Operating System; getting the name from the Operating System.
Therefore, you have:

   os_to_git_path( const NATIVECHAR * ospath, strbuf * gitpath );
   git_to_os_path( const char * gitpath, const NATIVECHAR * ospath, int oslen );

These can then be used to handle Operating System differences (e.g.
use WideCharToMultiByte/MultiByteToWideChar conversion on Windows to
map between UTF-8 and UCS-2/UTF-16).

If Mac has an API to handle its strange behaviour, that can be used
here as well.

  2.  Case (in)sensitivity

Here, you have the following cases:

  1.  git and the filesystem say that the files are different.

Update the git directory tree and move the file on the filesystem.

  2.  git and the filesystem say that the files are the same.

Generate an error as is currently done in git.

  3.  git says that the files are different, but the filesystem says
that the files are the same.

Allow the move, updating the git directory tree only.

- Reece
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help