line endings

Frits Jalvingh jal at etc.to
Thu Jul 12 17:22:50 UTC 2012


On Thu, Jul 12, 2012 at 7:22 PM, Frits Jalvingh <jal at etc.to> wrote:

> Hi,
>
> Files that bzr thinks are binary (like those png and others) should not be
> added to this file- they have no line endings, and bazaar will not confuse
> them as text.
>
> You specify that all files Bazaar thinks of as text files should have
> native line endings - which is right.
>
> I think what is causing your problem now is that you added that rules file
> *after* you have already created a repository. Say for instance you created
> a repo starting from Windows, without that rules file. Now all files in the
> *repository* have crlf line endings.
>
> Then you added the rules file on your Linux machine, and you branch a new
> copy. This copy will now have "lf" line endings, because you want native
> ones.
>
> Bazaar will, when you have that rules file active, change the "platform"
> line endings into what it calls the canonical format, and this is what is
> really stored in the repository. That canonical format is lf endings.
>
> So now you can see the problem: as soon as you touch a file Bazaar knows
> it has to compare the file to the repository to see if changes are made. It
> converts the line endings to "canonical" (lf - so no change for linux
> files) and compares to the repo.. But that was created with crlf endings -
> and hence the problem
>
> I think this is one of the worst parts of Bazaar, it is really easy to
> destroy your repository by forgetting to install that rules file 8-( I've
> lost multiple days there fixing occurrences like that.
>
> To fix your problem you can do two things:
>
> 1. You can checkout all of your files, use "touch" to mark all of them as
> changed and commit them back. This way all line endings in the repo change
> to canonical lf. Make sure you have nothing left to merge with or merge to,
> because everything after will be a conflict!!
>
> 2. You can change the "canonical" representation inside the repository to
> crlf:
>
> [name *]
> eol = native-with-crlf-in-repo
>
>
> Good luck,
>
> Frits
>
>
>
> On Thu, Jul 12, 2012 at 2:58 PM, Lucio Crusca <lucio at sulweb.org> wrote:
>
>> Hello *,
>>
>> I'm new to Bazaar (and to SCM systems in general). I'm trying to share a
>> single Bazaar repository hosted on a Windows share with two developer
>> workstations, one Windows, the other Linux, and I need the Linux
>> workstation
>> to convert line endings as needed between updates and commits.
>>
>> I'm the developer at the Linux box. Here is what I've written in my
>> $HOME/.bazaar/rules file:
>>
>> [name *.png]
>> eol = exact
>>
>> [name *.jar]
>> eol = exact
>>
>> [name *.zip]
>> eol = exact
>>
>> [name *.war]
>> eol = exact
>>
>> [name *]
>> eol = native
>>
>> However when I touch a single line in a file, bzr diff, bzr update, bzr
>> commit
>> see the whole file as it had been completely changed, I suppose because
>> of the
>> line endings.
>>
>> Assuming the problem was an empty $BZR_HOME, I also tried to
>>
>> $ export BZR_HOME=$HOME
>>
>> but nothing changed. I'm using Bazaar 2.6.0dev2.
>>
>> Any help?
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20120712/a74f2829/attachment-0001.html>


More information about the bazaar mailing list