Line ending translation extension

Martin Geisler mg at lazybytes.net
Mon Sep 7 02:56:18 CDT 2009


Mads Kiilerich <mads at kiilerich.com> writes:

> AFAICS the discussion so far haven't distinguished clearly between
> repo format and local format.
>
> For CR and CRLF files an obvious solution would be to do no
> translation and store the file as-is in the repo. Some could however
> in some cases want to store all repo files in the other format and
> convert on checkout.
>
> For "native" the "native" obviously refers to the local format. The
> repo format is less obvious, and it seems like there is a need to be
> able to specify how the files should be stored in the repo.

Yes, that's why the prototype I posted support a section like this in
the .hgeol file:

[repository]
native = CRLF

> And related: Why do people say that it is a problem related to
> windows? It only becomes a windows problem if it has been defined that
> the repo is in unix format. If someone decides that the repo is in
> windows format, then we suddenly have a unix problem and not a windows
> problem ...

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.

Another thing I don't understand is why people are afraid of files
changing line-ending "spontaneously"... I mean, the change will show up
in a *big way* in 'hg diff'! If you let people push changes to the
repository who doesn't notice that kind of changes, well then all bets
are off :-)

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.


More information about the Mercurial mailing list