[RFC] eol values: unix/windows or LF/CRLF?
John Arbash Meinel
john at arbash-meinel.com
Sat Mar 28 13:32:32 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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)]
'native': [...(_to_lf_converter, _native_outptut)]
etc
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAknOJvAACgkQJdeBCYSNAAMm1gCfed3OAycPHACNcfzB0EU2djUD
1joAoIjioJoJqjjE+s86jsYcLtoQKuZy
=0/FG
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list