End of line characters in bzr

John Arbash Meinel john at arbash-meinel.com
Thu Nov 2 15:45:02 GMT 2006


Nicholas Allen wrote:
> Thanks. I didn't notice that page ;-)
> 
> It seems like that is quite a big limitation in bazaar currently then.
> We work on Mac OSX, windows and occassionally Linux so it would be
> essential that bazaar does something sensible with the line endings.
> This is something that svn at least seems to do well (compared to bzr -
> it's about the only thing ;-)).

Well coming from CVS which *tried* to handle line endings, but got them
horribly wrong almost as often as it got them right. For example,
checkout on Windows, and the copy the file to a Unix machine and commit
it. And then the next checkout on Windows will have CRLFLF for every line.

SVN defaults to not touching your line endings either. Though you can
explicitly ask it for "native", versus always LF or CRLF or ...?

At this point, most editors can handle files in whatever line endings
they started with. So not modifying them is actually a rather sensible
thing to start with. It is far better than CVS mode.

> 
> Any idea on when bazaar will handle line endings properly (is that a 1.0
> goal)?
> 
> Cheers,
> 
> Nick
> 

We arguably handle them properly already as in "leave the files the way
they are". If your other tools are modifying the line endings, then it
is a bug in the other tools.

But we can be pragmatic about it, and try to help people work around
broken tools (we do it in other cases).

The page Alexander linked to has most of the discussion. I'm pretty sure
Martin thinks it is something to have. But it isn't a priority ATM.
Leaving things alone is a pretty good default. But if someone implements
a clean implementation that handles that we are using sha1 sums, so we
need to filter whenever we read and write... (You may need to keep 2 sha
sums, one for the current on-disk sum, and 1 for the after filtered sum.
Though you may only need the after-filtered)

John
=:->

> Alexander Belchenko wrote:
>> Nicholas Allen пишет:
>>> Just wondering how bzr deals with EOL characters. In the repository
>>> they are stored only as \n but in working tree they use the native OS
>>> line ending style don't they?
>>



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061102/faa02ccb/attachment.pgp 


More information about the bazaar mailing list