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

Re: Re: Moving a directory into another fails

From
Linus Torvalds <torvalds@osdl.org>
Date
Dec 4, 2006, 20:26 UTC
Message-ID
<Pine.LNX.4.64.0612041114240.3476@woody.osdl.org>
In-Reply-To
<Pine.LNX.4.63.0612042009590.28348@wbgn013.biozentrum.uni-wuerzburg.de>
On Mon, 4 Dec 2006, Johannes Schindelin wrote:
Show 20 quoted lines
> 
> On Mon, 4 Dec 2006, Jakub Narebski wrote:
> 
> > Johannes Schindelin wrote:
> > 
> > > On Mon, 4 Dec 2006, Jakub Narebski wrote:
> > > 
> > >> [...] git should acquire core.filesystemEncoding configuration variable 
> > >> which would encode from filesystem encoding used in working directory 
> > >> and perhaps index to UTF-8 encoding used in repository (in tree objects) 
> > >> and perhaps index.
> > > 
> > > So, you want to pull in all thinkable encodings? Of course, you could rely 
> > > on libiconv, adding yet another dependency to git. (Yes, I know, mailinfo 
> > > uses it already. But I never use mailinfo, so I do not need libiconv.)
> > 
> > A conditional dependency. If you don't have libiconv, this feature wouldn't
> > be available.
> 
> You are speaking as somebody compiling git from source. We are a minority.
You guys are ignoring the _real_ problem. 

It has nothing at all to do with dependencies on external packages. The REAL problem is that if you do locale-dependent trees and other git objects, git will STOP WORKING.

A filename in a tree object _has_ to be see as a pure 8-bit character stream. They _have_ to be compared with "memcmp()", and they have to sort the same way and mean EXACTLY the same thing for everybody.

If a filesystem cannot represent that name AS THAT BYTE SEQUENCE then the filesystem is broken. No ifs, buts, maybes about it. I'm sorry, but that's how it is.

This is _exactly_ the same issue as case independence. Git does not ignore case, and it really CANNOT ignore case. Ignoring case would cause horrible and deep problems, and it has nothing to do with dependencies on libraries (although it _would_ get much much worse from locale settings, and again having different locales compare the same name differently because case rules are different).

So it really boils down to one one: git saves a byte stream. Not text. 

This is true for all levels of the git archive. It's true for blob content, it's true for filenames in trees, and it is true for commits. The commit message is actually somewhat easier (because we have nothing to "compare" it to afterwards in the checked-out tree), so the commit message is the _one_ thing we can kind of play games with, but even there, once it's done, it's done, and it's just a stream of bytes.

Previous: Jakub NarebskiNext: Linus Torvalds
Message 12 of 24 in “Moving a directory into another fails”
  1. Jon SmirlJul 26, 2006
  2. Nicolas VilzJul 26, 2006
  3. Jon SmirlJul 26, 2006
  4. Nicolas VilzJul 26, 2006
  5. Petr BaudisJul 28, 2006
  6. Stefan PfetzingDec 4, 2006
  7. Jakub NarebskiDec 4, 2006
  8. Johannes SchindelinDec 4, 2006
  9. Jakub NarebskiDec 4, 2006
  10. Johannes SchindelinDec 4, 2006
  11. Jakub NarebskiDec 4, 2006
  12. Linus TorvaldsDec 4, 2006
  13. Linus TorvaldsDec 4, 2006
  14. Shawn PearceDec 4, 2006
  15. Jakub NarebskiDec 4, 2006
  16. Johannes SchindelinDec 4, 2006
  17. Linus TorvaldsDec 4, 2006
  18. Johannes SchindelinDec 5, 2006
  19. Jakub NarebskiDec 5, 2006
  20. filesystem encodings and gitweb tests, was Re: Moving a directory into another failsJohannes Schindelin, Dec 5, 2006
  21. Jakub NarebskiDec 5, 2006
  22. Johannes SchindelinDec 5, 2006
  23. Linus TorvaldsDec 5, 2006
  24. Johannes SchindelinDec 4, 2006

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.