git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC] File system difference handling in git

From
RDReece Dunn <msclrhd@googlemail.com>
Date
Jan 22, 2008, 09:21 UTC
Message-ID
<3f4fd2640801220121w60cb9a69u8519a7ceb81d3414@mail.gmail.com>
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
Next: Junio C Hamano
Message 1 of 8 in “[RFC] File system difference handling in git”
  1. Reece DunnJan 22, 2008
  2. Junio C HamanoJan 22, 2008
  3. Reece DunnJan 22, 2008
  4. Steffen ProhaskaJan 22, 2008
  5. Jonathan del StrotherJan 22, 2008
  6. Linus TorvaldsJan 22, 2008
  7. David KastrupJan 22, 2008
  8. Linus TorvaldsJan 22, 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.