[RFC] eol values: unix/windows or LF/CRLF?

Alexander Belchenko bialix at ukr.net
Sat Mar 28 14:34:53 GMT 2009


John Arbash Meinel пишет:
> Ian Clatworthy wrote:
>> I want to land EOL conversion into bzr.dev and I have
>> the code ready to go. I'm currently supporting values
>> named "unix" and "windows", i.e. what conventions to
>> follow when checking in text files.
> 
>> Alexander has suggested renaming them to LF and CRLF
>> respectively. Do people have strong opinions? I suspect
>> the latter is more likely to match a google search, i.e.
>> searching for "bzr crlf" will likely find the EOL
>> help nearer than top than "bzr windows newlines" will say.
>> My only concern is that unix/windows is likely to mean more
>> to non-programmers using bzr, e.g. technical writers?
> 
>> Ian C.
> 
> Looking at your filter stack, it seemed more focused on always providing
> "native" format in the working tree, and then providing a fixed format
> in the repository.
> 
> That may be a way to go, but I would have thought something like "unix"
> would force the working tree to be in LF, and if I messed up the working
> tree slightly, it would fix it up for me when that content was inserted
> into the repo.
> 
> I know that there are specific use cases where you *need* to checkout a
> file in CRLF on Windows (MSVC project files circa 7.1/2003), and there
> are ones you have to have in LF even on Windows (cygwin bash scripts
> that use '\' to wrap lines fail if that line has a '\r\n' ending. (it
> also fails if you put any whitespace, etc.)
> 
> Anyway, I'm thinking the actual values here don't really map at least to
> what *I* expected. Which is that if you set it to 'native', you would
> get local CRLF or LF on checkout, but always LF on checkin, and then
> things like 'unix', 'dos', and 'exact' would change what was in the
> working tree as well as what was in the repository. Given your formats:
> 
> 'exact': []
> 'unix': [...(_to_lf_converter, _to_lf_converter)]
> 'dos': [...(_to_crlf_converter, _to_crlf_converter)]

^-- is not this should be actually:

 'dos': [...(_to_lf_converter, _to_crlf_converter)]

I'm confused a lot. What the sense of having filter pair crlf/crlf?

> 'native': [...(_to_lf_converter, _native_outptut)]
> 
> etc
> 
> John
> =:->




More information about the bazaar mailing list