monotone-devel
[Top][All Lists]
Advanced

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

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


From: J Decker
Subject: Re: [Monotone-devel] Re: line endings with 0.31
Date: Wed, 22 Nov 2006 19:07:00 -0800

The logic for determining line endings within reasonable limits is entirely feasible in practice as well as theory.

On 11/21/06, Richard Levitte - VMS Whacker <address@hidden> wrote:
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
   extraction.
   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
extraction.

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
time.

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.

Cheers,
Richard

-----
Please consider sponsoring my work on free software.
See http://www.free.lp.se/sponsoring.html for details.

--
Richard Levitte                         address@hidden
                                         http://richard.levitte.org/

"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


_______________________________________________
Monotone-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/monotone-devel


reply via email to

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