[Monotone-devel] Re: Bug in CRLF conversions

2006-01-29 Thread Bruce Stephens
Yury Polyanskiy <[EMAIL PROTECTED]> writes: > I think there is a bug in CRLF<->LF conversions or at least unintended > behavior. > > Suppose the following scenario. > > function get_linesep_conv(fname) > return {"LF", "CRLF"} > end > > I expect to have all files translated from LF to

[Monotone-devel] Re: Bug in CRLF conversions

2006-01-29 Thread Bruce Stephens
Richard Levitte - VMS Whacker <[EMAIL PROTECTED]> writes: [...] > So, monotone needs to know internally if a file is text or non-text, > and needs to do conversions (both charset, which is a similar and > bigger can of worms) on text files only. Yes, I agree. I haven't done much experimentation

[Monotone-devel] Re: Bug in CRLF conversions

2006-01-30 Thread Bruce Stephens
Richard Levitte - VMS Whacker <[EMAIL PROTECTED]> writes: [...] > Or any line ending. It doesn't really matter because for text > files, the line ending isn't really interesting in itself, it's just > a layout indicator, saying "break the line here". (I realised this > yesterday, while discussi

[Monotone-devel] Re: Bug in CRLF conversions

2006-01-30 Thread Bruce Stephens
Zbynek Winkler <[EMAIL PROTECTED]> writes: [...] > I think I like more the way mercurial does this - it does not convert > anything by itself. But it allows you to specify "filters" (in/out) > that are called to process the files on commit or checkout. I think it > follows the principle of least

[Monotone-devel] Re: Bug in CRLF conversions

2006-01-30 Thread Bruce Stephens
Ethan Blanton <[EMAIL PROTECTED]> writes: [...] > This is precisely why Yury is correct. Because, on many systems, \r > and \n have _different meanings_, they should be properly and > reversibly preserved even in text files. I can believe that's true of some text files. But for (to take a rand

[Monotone-devel] Re: Bug in CRLF conversions

2006-02-01 Thread Bruce Stephens
Richard Levitte - VMS Whacker <[EMAIL PROTECTED]> writes: [...] > Everything that has been used as argument against that simple > principle of what a text file is are really special cases for very > special purposes, where some characters have been inserted for > layout purposes. I honestly am n

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

2006-01-29 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Sun, 29 Jan 2006 14:14:40 +, Bruce Stephens <[EMAIL PROTECTED]> said: monotone> Yury Polyanskiy <[EMAIL PROTECTED]> writes: monotone> monotone> > I think there is a bug in CRLF<->LF conversions or at monotone> > least unintended behavior. monotone> > monoton

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

2006-01-29 Thread Jon Bright
Richard Levitte - VMS Whacker wrote: Personally, I find it incredibly dangerous that you can defined the internal database line ending character... Me too. I've always argued that the database should have the canonical form (and that this canonical form should be LF-only for text files and

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

2006-01-29 Thread Yury Polyanskiy
Richard and Bruce, I'm sorry for confusion. I said from the very beginning that it is my fault to use conversion for binary files. What I say is that if someone sets conversion (whatever he wants charset, lineending) he can expect that *ANY* data will be converted back to the same state before d

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

2006-01-29 Thread Yury Polyanskiy
On Sun, 2006-01-29 at 19:42 +0100, Jon Bright wrote: > Me too. I've always argued that the database should have the canonical > form (and that this canonical form should be LF-only for text files and > whatever-the-file-has for binary or other "don't mess with the line > endings" files). My re

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

2006-01-29 Thread Jon Bright
Yury Polyanskiy wrote: Ah, ok! I see. You mean if Joe created a text-file in Windows and Ann created the very same text-file (except for damn line endings) in Linux you want them to be identical in DB even if Joe was dumb enough to not setup line ending conversion for the file? Is it what you sa

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

2006-01-29 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Sun, 29 Jan 2006 14:22:14 -0500, Yury Polyanskiy <[EMAIL PROTECTED]> said: ypolyans> Ah, ok! I see. You mean if Joe created a text-file in ypolyans> Windows and Ann created the very same text-file (except for ypolyans> damn line endings) in Linux you want them to

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

2006-01-29 Thread Jon Bright
Richard Levitte - VMS Whacker wrote: The only reason that we haven't had much problems yet is that most of us run on Unix, with get_linesep_conv undefined, which means no conversion is made. I wonder how people on Windows handle this. I've handled it recently on Windows. For .cpp files and .

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

2006-01-29 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Sun, 29 Jan 2006 14:03:18 -0500, Yury Polyanskiy <[EMAIL PROTECTED]> said: ypolyans> The behavior is unexpected in two aspects (as I said before): ypolyans> 1) split_lines(), join_lines() adds \n to the end of file ypolyans> if it lacked one ypolyans> 2) LF

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

2006-01-29 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Sun, 29 Jan 2006 20:46:01 +0100, Jon Bright <[EMAIL PROTECTED]> said: jon> For everything else, I had it store as LF and output LF - which jon> obviously works for binary too. Having them both the same is the only way to have it safe, since monotone recognises t

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

2006-01-29 Thread Yury Polyanskiy
On Sun, 2006-01-29 at 20:54 +0100, Richard Levitte - VMS Whacker wrote: > The two line endings returned by get_linesep_conv() are only used when > writing the files. When reading them (at least when reading them from > the workspace), monotone is trying to be smart and looks for all kinds > of lin

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

2006-01-29 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Sun, 29 Jan 2006 15:09:54 -0500, Yury Polyanskiy <[EMAIL PROTECTED]> said: ypolyans> On Sun, 2006-01-29 at 20:54 +0100, Richard Levitte - VMS Whacker wrote: ypolyans> > If you want to focus on something, I'd focus on getting ypolyans> > monotone to handle binary

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

2006-01-29 Thread Jon Bright
Richard Levitte - VMS Whacker wrote: In message <[EMAIL PROTECTED]> on Sun, 29 Jan 2006 20:46:01 +0100, Jon Bright <[EMAIL PROTECTED]> said: jon> For everything else, I had it store as LF and output LF - which jon> obviously works for binary too. Having them both the same is the only way to ha

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

2006-01-29 Thread Yury Polyanskiy
On Sun, 2006-01-29 at 21:32 +0100, Richard Levitte - VMS Whacker wrote: > Nope. Consider a binary file, which might contain anything and let's > consider a get_linesep_conv that always returns {"LF","CR"} (because > we run it on Mac, that's why). Let's use a hypothetical monotone that Well I wa

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

2006-01-29 Thread Larry Hastings
Speaking as a Windows developer, let me pitch in with a couple thoughts: Casual Windows users may not have software that copes with varying line endings, but all the programmer's editors deal with it no problem.  Still, it'd be nice if monotone helped to mitigate the problem. Personall

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

2006-01-29 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Sun, 29 Jan 2006 16:26:13 -0500, Yury Polyanskiy <[EMAIL PROTECTED]> said: ypolyans> On Sun, 2006-01-29 at 21:32 +0100, Richard Levitte - VMS Whacker wrote: ypolyans> ypolyans> > Nope. Consider a binary file, which might contain ypolyans> > anything and let's

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

2006-01-29 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Sun, 29 Jan 2006 22:20:18 +, Bruce Stephens <[EMAIL PROTECTED]> said: monotone> Yes, I agree. I haven't done much experimentation, but monotone> presuming I'm understanding it correctly, subversion does it monotone> more or less right: monotone>

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

2006-01-29 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Sun, 29 Jan 2006 17:20:59 -0800, Larry Hastings <[EMAIL PROTECTED]> said: larry> Speaking as a Windows developer, let me pitch in with a couple thoughts: [...] larry> * Personally I'd prefer it if monotone stored text files in larry> some canonical form

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

2006-01-29 Thread Jon Bright
Larry Hastings wrote: * Casual Windows users may not have software that copes with varying line endings, but all the programmer's editors deal with it no problem. Still, it'd be nice if monotone helped to mitigate the problem. Editors may do, but at least Borland's C++ c

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

2006-01-30 Thread Ethan Blanton
Richard Levitte - VMS Whacker spake unto us the following wisdom: > In message <[EMAIL PROTECTED]> on Sun, 29 Jan 2006 16:26:13 -0500, Yury > Polyanskiy <[EMAIL PROTECTED]> said: > ypolyans> Some motivation why maybe it still should be done. Why we > ypolyans> want line endings translation at all?

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

2006-01-30 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Mon, 30 Jan 2006 12:31:42 +0100, Zbynek Winkler <[EMAIL PROTECTED]> said: zwin> Richard Levitte - VMS Whacker wrote: zwin> zwin> >monotone> However, the basic idea seems sound: distinguish zwin> >monotone> binary and text, and for text, assume (by default) zwin>

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

2006-01-30 Thread Zbynek Winkler
Richard Levitte - VMS Whacker wrote: monotone> However, the basic idea seems sound: distinguish binary and monotone> text, and for text, assume (by default) native line-endings. Or any line ending. It doesn't really matter because for text files, the line ending isn't really interesting in its

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

2006-01-30 Thread Larry Hastings
Bruce Stephens wrote: (I'm also not convinced by your python example: python is well known for using layout as syntax, so there's no contradiction in saying that a line break is "just a layout indicator", and that it indicates the end of a statement.) Just so.  I just tested with Python

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

2006-01-30 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Mon, 30 Jan 2006 07:36:09 -0500, Ethan Blanton <[EMAIL PROTECTED]> said: eblanton> Richard Levitte - VMS Whacker spake unto us the following wisdom: eblanton> > In message <[EMAIL PROTECTED]> on Sun, 29 Jan 2006 16:26:13 -0500, Yury Polyanskiy <[EMAIL PROTECTED]

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

2006-01-31 Thread Yury Polyanskiy
On Mon, 2006-01-30 at 07:36 -0500, Ethan Blanton wrote: > This is precisely why Yury is correct. Because, on many systems, \r > and \n have _different meanings_, they should be properly and > reversibly preserved even in text files. What Yury is saying, if I > understand it correctly, is that the

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

2006-01-31 Thread Yury Polyanskiy
On Mon, 2006-01-30 at 13:59 +, Bruce Stephens wrote: > I can believe that's true of some text files. But for (to take a > random example) C++ source files, it's surely not true, is it? That's the problem with current approach: it only takes C/C++ sources into account. > I'd expect to get C

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

2006-01-31 Thread Matthew Hannigan
On Tue, Jan 31, 2006 at 07:50:51AM -0500, Yury Polyanskiy wrote: > Again: solution is trivial. "Transform what I ask you to (LF->CRLF and > back) and don't mess with anything special (like CR->CRLF etc)." The other nice thing about this is that it's perfectly reversible, even for 'binary' files.

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

2006-01-31 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Wed, 1 Feb 2006 14:13:18 +1100, Matthew Hannigan <[EMAIL PROTECTED]> said: mlh> On Tue, Jan 31, 2006 at 07:50:51AM -0500, Yury Polyanskiy wrote: mlh> > Again: solution is trivial. "Transform what I ask you to mlh> > (LF->CRLF and back) and don't mess with anythin

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

2006-01-31 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Tue, 31 Jan 2006 07:50:51 -0500, Yury Polyanskiy <[EMAIL PROTECTED]> said: yura_pol> On Mon, 2006-01-30 at 13:59 +, Bruce Stephens wrote: yura_pol> > I can believe that's true of some text files. But for (to yura_pol> > take a random example) C++ source file

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

2006-02-01 Thread Thomas Moschny
Quoting Matthew Hannigan: > On Tue, Jan 31, 2006 at 07:50:51AM -0500, Yury Polyanskiy wrote: > > Again: solution is trivial. "Transform what I ask you to (LF->CRLF and > > back) and don't mess with anything special (like CR->CRLF etc)." > > The other nice thing about this is that it's perfectly > r

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

2006-02-01 Thread Joel Crisp
This is why I believe something like the Clearcase Type manager would be useful. You would then be able to associate a type with a file and bind all of the transforms, diffing tool profiles etc to the type record. Joel smime.p7s Description: S/MIME Cryptographic Signature ___

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

2006-02-01 Thread Ethan Blanton
Thomas Moschny spake unto us the following wisdom: > Quoting Matthew Hannigan: > > On Tue, Jan 31, 2006 at 07:50:51AM -0500, Yury Polyanskiy wrote: > > > Again: solution is trivial. "Transform what I ask you to (LF->CRLF and > > > back) and don't mess with anything special (like CR->CRLF etc)." > >

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

2006-02-01 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Wed, 1 Feb 2006 07:24:22 -0500, Ethan Blanton <[EMAIL PROTECTED]> said: eblanton> Richard Levitte - VMS Whacker spake unto us the following wisdom: eblanton> > mlh> On Tue, Jan 31, 2006 at 07:50:51AM -0500, Yury Polyanskiy wrote: eblanton> > mlh> > Again: soluti

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

2006-02-01 Thread Ethan Blanton
Richard Levitte - VMS Whacker spake unto us the following wisdom: > mlh> On Tue, Jan 31, 2006 at 07:50:51AM -0500, Yury Polyanskiy wrote: > mlh> > Again: solution is trivial. "Transform what I ask you to > mlh> > (LF->CRLF and back) and don't mess with anything special (like > mlh> > CR->CRLF etc).

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

2006-02-01 Thread Ethan Blanton
Richard Levitte - VMS Whacker spake unto us the following wisdom: > In message <[EMAIL PROTECTED]> on Wed, 1 Feb 2006 07:24:22 -0500, Ethan > Blanton <[EMAIL PROTECTED]> said: > eblanton> Richard Levitte - VMS Whacker spake unto us the following wisdom: > eblanton> > mlh> On Tue, Jan 31, 2006 at 0

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

2006-02-01 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Wed, 1 Feb 2006 21:19:37 -0500, Ethan Blanton <[EMAIL PROTECTED]> said: eblanton> Richard Levitte - VMS Whacker spake unto us the following wisdom: eblanton> > In message <[EMAIL PROTECTED]> on Wed, 1 Feb 2006 07:24:22 -0500, Ethan Blanton <[EMAIL PROTECTED]> sa

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

2006-02-02 Thread rghetta
Richard Levitte - VMS Whacker wrote: > Ah, this one hit the nail. We still disagree on what a text file > really is. To me, a "text file" with embedded control characters (ANY > embedded control character, like \r on a Unix system unless it's part > of \r\n) are not really text files, they should

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

2006-02-02 Thread Zbynek Winkler
rghetta wrote: Btw, something in Yury's example made me think a bit, and it occured to me that if the database line ending would be CRLF and we only convert from and to the platform specific line ending, we would have something reversible the way I understand "reversible" (this is under the cond

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

2006-02-02 Thread Ethan Blanton
Richard Levitte - VMS Whacker spake unto us the following wisdom: > In message <[EMAIL PROTECTED]> on Wed, 1 Feb 2006 21:19:37 -0500, Ethan > Blanton <[EMAIL PROTECTED]> said: > eblanton> Given this set of rules, I claim that *text conversions* are > eblanton> as optimal as can be expected. Monot

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

2006-02-02 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Thu, 02 Feb 2006 08:55:47 +0100 (CET), Richard Levitte - VMS Whacker <[EMAIL PROTECTED]> said: richard> In message <[EMAIL PROTECTED]> on Thu, 02 Feb 2006 07:58:24 +0100, rghetta <[EMAIL PROTECTED]> said: richard> richard> birrachiara> I think monotone should *

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

2006-02-02 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Thu, 02 Feb 2006 21:22:06 +0100, rghetta <[EMAIL PROTECTED]> said: birrachiara> Richard Levitte - VMS Whacker wrote: birrachiara> > The inspiration for .mt-autoprops comes from SVN, where birrachiara> > such things can be configured. They do it by birrachiara> >

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

2006-02-02 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Thu, 02 Feb 2006 07:58:24 +0100, rghetta <[EMAIL PROTECTED]> 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

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

2006-02-02 Thread rghetta
Richard Levitte - VMS Whacker wrote: The inspiration for .mt-autoprops comes from SVN, where such things can be configured. They do it by extension, but I'm not sure we really should do it that way... I've always been impressed by the simple magic of the Unix command 'file', but doing something

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

2006-02-02 Thread Larry Hastings
FWIW, the Perforce documentation says they handle EOL translations like this: When you add a file, you can explicitly specify what "type" it is.  Valid types in the current version are "binary", "text", "symlink", "unicode", and two types for those funny Macintosh resource files ("apple" an

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

2006-02-02 Thread Nuno Lucas
On 2/2/06, rghetta <[EMAIL PROTECTED]> wrote: > I think monotone should *not* change the file unless instructed to do > so, i.e. every file should be non-transformable by default. > Transformable files instead could be converted between "equivalent" > forms, e.g. with a different line endings, with

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

2006-02-02 Thread hendrik
On Thu, Feb 02, 2006 at 07:11:01AM +0100, Richard Levitte - VMS Whacker wrote: > > Oh, so you and I do understand "reversible" differently. To me, > "reversible" means there is a 1 to 1 mapping between the original file > (the one being checked in) and the resulting file (the one being check > ou