[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Re: line endings with 0.31

From: Richard Levitte - VMS Whacker
Subject: Re: [Monotone-devel] Re: line endings with 0.31
Date: Tue, 21 Nov 2006 12:35:08 +0100 (CET)

I've been thinking about this issue a number of times, and have
discussed it as well.

A thought that came to my mind a while ago was that we could really
make this really simple:

 - always store the file unchanged, and for text files (according to
   some criteria), store the local EOL format in an attribute.
   mtn:eol = CR, mtn:eol = LF or mtn:eol = CRLF
 - for text files, always convert to the local EOL format on
   So if something was stored with mtn:eol = CR (on a Mac, typically),
   all CRs would be converted to LF on a Unix system, or to CRLF on a
   Windows system.

One might wonder what happens during a merge of two revisions where
the same file is stored with different EOL formats in the different
revisions.  Quite simple, since they get converted to the local format
on extraction, I'm assuming that what's merged is the result after

Now, please, before you start reacting, I *know* that the whole file
isn't stored, only the delta.  Unfortunately, I know diddly over squat
about xdelta, so a question is if storing different EOL formats at
different times creates more trouble than it's worth.

On the plus side, it means that storing a file (or the delta) will
always happen without conversion, whether it's binary or text, and the
user can remember to add the EOL attribute as an afterthought, at any

If we would do this rigorously, we wouldn't need any hooks either,
really, unless someone really wants to override the default function.

Now, the next, and somewhat related thing (or can of worms) is
character code conversion.


Please consider sponsoring my work on free software.
See for details.

Richard Levitte                         address@hidden

"When I became a man I put away childish things, including
 the fear of childishness and the desire to be very grown up."
                                                -- C.S. Lewis

reply via email to

[Prev in Thread] Current Thread [Next in Thread]