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

Ian Clatworthy ian.clatworthy at internode.on.net
Sat Mar 28 14:17:34 GMT 2009


John Arbash Meinel wrote:

> 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's right. In the vast majority of cases, users want things checked
out using the conventions native to their OS. So the key issue becomes

  "what format do we *store* files in".

I've made an effort in the latest documentation to make that clearer.

> 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.)

So my current answer to that (again explained in the latest doc) is
"check the file in using the required format and explicitly specify
eol=exact for those files" to ensure they don't get converted on
read or write via some more global rule.

I'm really keen here to keep eol *conversion* to some very simple
rules. There certainly is a need for intelligent *checking* of
content and I feel that ought to be handled elsewhere, e.g. in
a precommit hook or whitespace content filter. In particular, if
a *.msvc file is "bad", maybe the right thing to do is abort the
commit rather than implicitly munge it on commit via a content filter.

Ian C.



More information about the bazaar mailing list