git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael Garcia-Suarez" <rgarciasuarez@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: "Sam Vilain" <sam.vilain@catalyst.net.nz>,
	git@vger.kernel.org, "Peter Karlsson" <peter@softwolves.pp.se>,
	"Mark Junker" <mjscod@web.de>,
	"Pedro Melo" <melo@simplicidade.org>,
	"Martin Langhoff" <martin.langhoff@gmail.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Dmitry Potapov" <dpotapov@gmail.com>,
	"Kevin Ballard" <kevin@sb.org>
Subject: Re: [PATCH] [RFC] Design for pathname encoding gitattribute [RESEND]
Date: Tue, 22 Jan 2008 10:13:12 +0100	[thread overview]
Message-ID: <b77c1dce0801220113y3f33c7fjf8fd0cd2c2763274@mail.gmail.com> (raw)
In-Reply-To: <7vr6gatidd.fsf@gitster.siamese.dyndns.org>

On 22/01/2008, Junio C Hamano wrote:
> If the project uses UTF-8-NFC, we would need to adjust check-in
> and check-out codepath like Linus's readdir(3) hack suggested,
> but that needs to be done only on HFS+.  Of course, the project
> participants need to be careful not to create files that HFS+
> cannot handle (two paths that happen to be equivalent strings
> should not be created), but I do not think that is such a big
> issue as some people seem to make a big deal out of.  If you

Right, I don't see that as a big issue -- for new files. But we can have
files that were created in the past as non-handleable by HFS+, and later
renamed to something more portable.

More generally, the consensus encoding might change over time. We can
imagine a project which contains, say, a test file which a latin-1 name,
that gets later renamed to a UTF-8 name, (due to a project policy
change), but making necessary to adjust the said test. A checkout of the
earlier version would have that test failing. (But maybe I'm just
handwaving towards a non-existent problem here. I'd consider the issue
as minor anyway.)

> want to be interoperable with different filesystems, you should
> not create two paths that are different only in case, and if
> there are participants who are on such a filesystem, the mistake
> is quickly spotted and corrected.  It happened in git.git to a
> file other than that infamous Märchen.  It's exactly the same
> issue [*1*].
>
> In short, initially I did not like Linus's readdir(3) hack very
> much, but the more I think about it, I like it the better.
>
> We pick a reasonable default (i.e. "no conversion") at the
> technical level, and recommend (but do not pay for the overhead
> of enforcing) a reasonable normalization as the BCP at the human
> level.  Only on filesystems that mangle the pathnames, or if you
> want legacy encodings on the filesystem, we would need to pay
> overhead for conversion and help people with actual code to do
> so.
>
> To support the above scenarios, I think each instance of
> repository needs to be able to say "this path (specified with a
> matching pattern in the filename encoding) should be converted
> this way coming in, and that way going out."  UTF-8 only project
> would have NKC<->NKD on HFS+ partition, and nothing on
> everywhere else.  EUC-JP project that checks out as-is would
> specify nothing either, but people on Shift_JIS platforms would
> locally specify that EUC-JP <-> Shift_JIS conversion to be made.

Sounds sane, except maybe the part where you specify paths with a
pattern. Do you really need this layer of complexity? Pattern matching
in different encodings has proven to be troublesome. Usually that's
where UTF-8 normalisation rules and locale-specific behaviours kick in,
esp. when you're starting to use \w or \d characters classes, or case
insensitivity. For example, if you want to do it correctly, "I" will
match /i/ case-insensitively, except in Turkish locales... (Sorry, I'm
just handwaving again here...)

  parent reply	other threads:[~2008-01-22  9:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-22  4:41 [PATCH] [RFC] Design for pathname encoding gitattribute [RESEND] Sam Vilain
2008-01-22  5:35 ` Johannes Schindelin
2008-01-22  6:37   ` Junio C Hamano
2008-01-22  6:26 ` Junio C Hamano
2008-01-22  7:43   ` Junio C Hamano
2008-01-22  8:09     ` Mark Junker
2008-01-22  9:16       ` Junio C Hamano
2008-01-22  9:13     ` Rafael Garcia-Suarez [this message]
2008-01-22  9:57     ` Sam Vilain
2008-01-22 10:36       ` Junio C Hamano
2008-01-22 10:44         ` Sam Vilain

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=b77c1dce0801220113y3f33c7fjf8fd0cd2c2763274@mail.gmail.com \
    --to=rgarciasuarez@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=dpotapov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kevin@sb.org \
    --cc=martin.langhoff@gmail.com \
    --cc=melo@simplicidade.org \
    --cc=mjscod@web.de \
    --cc=peter@softwolves.pp.se \
    --cc=sam.vilain@catalyst.net.nz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).