my strategy on implementing line-endings (eol) support

Ian Clatworthy ian.clatworthy at internode.on.net
Thu Apr 3 00:39:54 BST 2008


Alexander Belchenko wrote:

> This is exactly my strategy on eol support:
> 
> a) Internally bzr stores files of type 3 with LF-only eol
> b) When file is created on disk bzr will use file property called 'eol'
> to determine
>   what kind of eol user needs
> c) status and diff operations should ignore eol, and treat them as LF
> d) commit convert all kind of eol to LF and store file with LF eol in
> repository.

In my previous job, we deployed our application on Windows but many of
us developed on Linux. We explicitly wanted some files to have DOS line
endings so that they rendered correctly in notepad. We need to make sure
that our eol support isn't too smart - this sort of "just store what I
tell you" thing needs to be possible.

The vast majority of text files were source code though and Unix line
ending were preferred. If control-Ms crept into those files because one
of the team developing on Windows created them outside their IDE say,
then we explicitly went and changed the eol's in those files as a
commit. Again, this needs to be possible. Furthermore, status and diff
need to show these files as truly changed in this case.

Ian C.



More information about the bazaar mailing list