Line ending translation extension

Paul Moore p.f.moore at gmail.com
Mon Sep 7 03:47:23 CDT 2009


2009/9/7 Martin Geisler <mg at lazybytes.net>:
> No, we don't have a Unix problem since (in my experience) tools on that
> platform can deal nicely with files ending in \r\n. That is what makes
> it difficult and strange for us Linux-only guys to hear users on Windows
> be so worried of line-endings.

There's a lot of FUD in this thread, and I'm concerned that I might be
adding more here, but nevertheless...

Consider a repo with all files mandated to use \r\n line endings. Now
say that you clone that repo, add a new file, then commit and push. I
would be very surprised if the file you added (on Unix) did *not* have
\n line endings - for it to be otherwise would require your tool to
look at other files in the directory and somehow guess that \r\n line
endings are required for new files. So you've now violated the EOL
policy for the repo.

You've just hit *exactly* one of the issues Windows users need to be
concerned about (switching \r\n and \n throughout).

That's probably the key breakage that people are worried about. There
are others, but they are lower probability, and *may* be somehow
related to using tools that don't handle line endings well. So maybe
Unix users won't see them (although anecdotally, I gather that Macs
may be more prone to this type of issue than "plain" Unix).

But nevertheless, this is somewhat irrelevant. We, as a community
using multiple OSes and multiple tools, have an issue to address.
Arguing over who is capable of addressing it is not productive. Trying
to understand the issue so that we can fix it, *is* helpful - as
things stand I don't believe the issue is entirely clear - partly
because it's based round "what if" speculation (because Python hasn't
made the switch yet, so actual experience isn't available), but to a
large extent because whenever a specific concern is raised, the
response is not "can you clarify", but rather "that doesn't happen for
me" or "that's not a problem" or "don't do that then" or variations on
these.

I'll try to post a summary of the key issues as I see them, in a way
that everyone (Unix or Windows user) can understand. But it'll take me
some time (maybe a week or more) as I'm a bit snowed under with real
life, and my PC is in a state of flux (ie, moderately unusable :-() at
the moment - so if anyone else wants to do this, go ahead. (Feel free
to ping me after a week if I've not done anything and it still needs
doing).

Paul.


More information about the Mercurial mailing list