You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by Frank Scholten <fr...@frankscholten.nl> on 2012/03/02 12:19:38 UTC

Git / Line separators / Patches

Hi all,

I am merging some changes from trunk in my local feature branch
MAHOUT-944 and I have problems with line endings.

When merging I do 'Accept theirs' in IntelliJ for all files since I
haven't touched them for my feature.
When committing I get a dialog saying there are differences in line
endings and I could convert the files or leave it as is.
No matter what I choose when I commit and do a diff I get this huge
patch with changes that have nothing to do with my actual patch.
They shouldn't be in the diff because trunk has them and my branch has
them as well.

The diffs shows a minus for every line in these files and then the
same file with a plus in front even though I haven't touched them at
all.

Any ideas how to solve this?

Cheers,

Frank

Re: Git / Line separators / Patches

Posted by Frank Scholten <fr...@frankscholten.nl>.
Thanks for the link Oliver. I set auto.crlf to input as I work on Linux.

I opened a diff between trunk and the latest 5 commits in geany (text
editor) to inspect line endings and I found that some files in some
commits contained
CRLF's while others only LFs.

For example the changes to DirichletClusterMapper has CRLFs while the
ClusterClassificationMapper has only LFs even though they were from
the same commit.

So I guess it is ok if my patch contains changes which remove the CR's
as LFs is the default?

Cheers,

Frank

On Fri, Mar 2, 2012 at 2:54 PM, Oliver B. Fischer <ma...@swe-blog.net> wrote:
> Hi Frank,
>
> I had an similar issue in one of my own project. I solved it by setting
> core.autocrlf=input for my project.
>
> See http://help.github.com/line-endings/ for details on this.
>
> HTH
>
> Oliver
>
> Am 02.03.2012 12:19, schrieb Frank Scholten:
>
>> Hi all,
>>
>> I am merging some changes from trunk in my local feature branch
>> MAHOUT-944 and I have problems with line endings.
>>
>> When merging I do 'Accept theirs' in IntelliJ for all files since I
>> haven't touched them for my feature.
>> When committing I get a dialog saying there are differences in line
>> endings and I could convert the files or leave it as is.
>> No matter what I choose when I commit and do a diff I get this huge
>> patch with changes that have nothing to do with my actual patch.
>> They shouldn't be in the diff because trunk has them and my branch has
>> them as well.
>>
>> The diffs shows a minus for every line in these files and then the
>> same file with a plus in front even though I haven't touched them at
>> all.
>>
>> Any ideas how to solve this?
>>
>> Cheers,
>>
>> Frank
>
>

Re: Git / Line separators / Patches

Posted by "Oliver B. Fischer" <ma...@swe-blog.net>.
Hi Frank,

I had an similar issue in one of my own project. I solved it by setting 
core.autocrlf=input for my project.

See http://help.github.com/line-endings/ for details on this.

HTH

Oliver

Am 02.03.2012 12:19, schrieb Frank Scholten:
> Hi all,
>
> I am merging some changes from trunk in my local feature branch
> MAHOUT-944 and I have problems with line endings.
>
> When merging I do 'Accept theirs' in IntelliJ for all files since I
> haven't touched them for my feature.
> When committing I get a dialog saying there are differences in line
> endings and I could convert the files or leave it as is.
> No matter what I choose when I commit and do a diff I get this huge
> patch with changes that have nothing to do with my actual patch.
> They shouldn't be in the diff because trunk has them and my branch has
> them as well.
>
> The diffs shows a minus for every line in these files and then the
> same file with a plus in front even though I haven't touched them at
> all.
>
> Any ideas how to solve this?
>
> Cheers,
>
> Frank