A good start for making Git cross-platform, would be storing the text
encoding of every file name and commit message together with the
commit. Currently, because Git is oblivious to the encodings and just
considers them as a series of bytes, there is no way to make them
cross-platform. It's as http://www.joelonsoftware.com/articles/Unicode.html
says, "It does not make sense to have a string without knowing what
encoding it uses." Without explicit encoding information, making a
system that works even on the three main platforms, let alone in all
countries and languages, is simply not possible.
On the other hand, if the encoding is explicitly stated in the
repository, then it is possible for platform and locale aware Git
clients to handle the file names and commit messages in whatever way
makes most sense for the platform (for example convert the file names
to the platform's encoding, if it differs from the committer's
platform encoding). Then it would also be possible to create a Mac
version of Git, which compensates for Mac OS X's file system's file
name encoding peculiarities. Also the system could then warn (on "git
add") if the data does not look like it has been encoded with the said
encoding.
If the platform's and the repository's encoding happen to be the same
(which in reality might be possible only inside a small company where
everybody is forced to use the same OS and is configured by a single
sysadmin), then no conversions need to be done. Also Git purists, who
think that the byte sequence representing a file name are more
important than the human readable version of the file name, may use
some configuration switch that disables all conversions - but even
then the current encoding should be stored together with the commit.
Are there any plans on storing the encoding information of file names
and commit messages in the Git repository? How much time would
implementing it take? Any ideas on how to maintain backwards
compatibility (for old commits that do not have the encoding
information)?
- Esko
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html