All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Jakub Narebski <jnareb@gmail.com>,
	git@vger.kernel.org
Subject: Re: Re: Moving a directory into another fails
Date: Mon, 4 Dec 2006 15:54:07 -0500	[thread overview]
Message-ID: <20061204205407.GB6764@spearce.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0612041114240.3476@woody.osdl.org>

Linus Torvalds <torvalds@osdl.org> wrote:
> 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.

Yes!

In jgit I assumed all tree entry names were encoded in UTF8.
Then I later learned they aren't.  Foolish me.

As Linus points out its a HUGE problem that the caller of
git-write-tree gets to decide what encoding should be used for
that tree.  Especially if someone else wants to use a different
encoding for the same filename (think ISO-8859-1 vs. UTF-8)!

I'd rather just force the tree entry names to be encoded in UTF-8
always, as its compact for most western texts (which many filenames
are), and at least degrades to supporting the non western texts.

A per-project setting is essentially impossible as we have
no such concept today, and a per-repository setting (like
i18n.commitEncoding) lets two different users encode the same
filename differently, which means two different tree SHA1s with
the exact same content... not correct!
 
> 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.

Commit encoding is a problem.  Clearly the "header parts"
(tree, parent) are US-ASCII but the author and committer lines
can be anything.  So can the body.  And we have no way of knowing
what encoding was used years later, we can only guess and display
it wrong.

We really should either normalize all commit messages to a single
encoding (again, UTF-8) or embed the encoding as part of the headers
somehow (e.g. look at how XML embeds the document encoding in the
start of the document).

-- 

  parent reply	other threads:[~2006-12-04 20:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-26 15:00 Moving a directory into another fails Jon Smirl
2006-07-26 22:34 ` Nicolas Vilz
2006-07-26 23:03   ` Jon Smirl
2006-07-26 23:25     ` Nicolas Vilz
2006-07-28  1:43     ` Petr Baudis
2006-12-04 18:19       ` Stefan Pfetzing
2006-12-04 18:56         ` Jakub Narebski
2006-12-04 19:03           ` Johannes Schindelin
2006-12-04 19:10             ` Jakub Narebski
2006-12-04 19:10               ` Johannes Schindelin
2006-12-04 19:37                 ` Jakub Narebski
     [not found]                   ` <7617FA7E-D49A-4A4C-B033-C2CB20623F5F@wf227.com>
2006-12-04 21:01                     ` Johannes Schindelin
2006-12-04 20:26                 ` Linus Torvalds
2006-12-04 20:51                   ` Linus Torvalds
2006-12-04 20:54                   ` Shawn Pearce [this message]
2006-12-04 20:56                   ` Jakub Narebski
2006-12-04 21:05                   ` Johannes Schindelin
2006-12-04 21:23                     ` Linus Torvalds
2006-12-05  7:34                       ` Johannes Schindelin
2006-12-05  9:36                         ` Jakub Narebski
2006-12-05 14:11                           ` filesystem encodings and gitweb tests, was " Johannes Schindelin
2006-12-05 14:29                             ` Jakub Narebski
2006-12-05 14:40                               ` Johannes Schindelin
2006-12-05 17:11                         ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061204205407.GB6764@spearce.org \
    --to=spearce@spearce.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.