monotone-devel
[Top][All Lists]
Advanced

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

[Monotone-devel] Re: the line-ending discussion


From: Graydon Hoare
Subject: [Monotone-devel] Re: the line-ending discussion
Date: Thu, 02 Feb 2006 16:48:26 -0800
User-agent: Thunderbird 1.5 (X11/20051201)

Yury Polyanskiy wrote:

 My original question was very simple: how you specify what "treat by a
sequence of lines" means? Does it mean converting all weird combinations
of CR and LF into line-ending or just convert "native line ending" into
line-ending?

Let us be clear, and talk about 4 specific operations. When I say "sequence of bytes" I mean "std::string". When I say "sequence of lines" I mean "std::vector<std::string>". Here are the operations:

  1. workspace file -> std::vector<std::string>
  2. workspace file <- std::vector<std::string>
  3. workspace file -> std::string
  4. workspace file <- std::string

When a file is considered "lines" (by attribute), it is subject to operations 1 and 2. When a file is considered "bytes", it is subject to operations 3 and 4.

Operations 3 and 4 are byte-copy operations.

Operations 1 and 2 are done by splitting or joining. The split and join operations are governed by the following rules:

   - At first, monotone's default behavior will be to use the "native"
     line-ending forms (only LF on unix, only CR on mac, only CRLF on
     windows). If you are sharing your workspace between platforms on
     NFS or SMB, you are out of luck. For now.

   - Once we have a mechanism for specifying project policies, it will
     be a matter of project policy, and you can split and join lines
     using whatever you want.

This is not what monotone does now, but I find it an agreeable road forwards. Does anyone disagree?

-graydon





reply via email to

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