monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] Re: Bug in CRLF conversions


From: Richard Levitte - VMS Whacker
Subject: Re: [Monotone-devel] Re: Bug in CRLF conversions
Date: Thu, 02 Feb 2006 08:55:47 +0100 (CET)

In message <address@hidden> on Thu, 02 Feb 2006 07:58:24 +0100, rghetta 
<address@hidden> said:

birrachiara> > Btw, something in Yury's example made me think a bit,
birrachiara> > and it occured to me that if the database line ending
birrachiara> > would be CRLF and we only convert from and to the
birrachiara> > platform specific line ending, we would have something
birrachiara> > reversible the way I understand "reversible" (this is
birrachiara> > under the condition that no file ever magically appears
birrachiara> > in the database without having been committed to it).
birrachiara> > And in this case, it would work to do this with ALL
birrachiara> > files back and forth, even non-transformables.

birrachiara> I don't understand what you mean. Under your definition
birrachiara> of non-transformable and reversible, any file with
birrachiara> embedded CRLF can't be properly converted "back and
birrachiara> forth".

Sorry, you're right, ignore that entirely, that was a major brain
fart.

birrachiara> I think monotone should *not* change the file unless
birrachiara> instructed to do so, i.e. every file should be
birrachiara> non-transformable by default.

Mmm, so that takes it the other way, you'll have to tell monotone
that a file is transformable.  I can deal with that, but that's really
the same issue as making sure you don't transform non-transformable
files, technically speaking.  Same operation, different parameters.

birrachiara> Perhaps we should consider a set of attributes
birrachiara> (explicitly or through tables) describing how to treat a
birrachiara> file when committing, merging, checking out.
birrachiara> Some of these attributes could be overriden by the user,
birrachiara> to allow for different line ending or merge tool
birrachiara> preferences.

Absolutely.  I can see three different attributes: transformable
(values: "yes" or "no"), eol ("native", "CR", "LF", "CRLF", "LFCR")
and charset ("native", "UTF8", ...).  We currently have those in form
of the "manual_merge" attribute and the values returned by
get_linesep_conv() and get_charset_conv().

I *like* the way attributes (like "manual_merge") are currently
initialised and used to do something with the files in lua, that's a
nice way to have the users place that attribute on the files they want
or need and make sure those attributes are carried out when and if
needed.
I strongly *dislike* that "mtn:manual_merge" is an attribute that's
obviously only looked at during merge (in the method
content_merger::try_to_merge_files()) and nowhere else.
I *dislike* everything about get_linesep_conv() and get_charset_conv()
more and more the longer I think about them.  In my opinion, they
should not even exist today.  And if they should exist for some
reason, they should at the very least NOT try to tell monotone what
linesep and charset to use internally!

All this said, I think it's time I give this a go for real.

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




reply via email to

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