You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Tim Ellison <t....@gmail.com> on 2006/03/29 23:14:53 UTC

EOL differences in svn diffs

Nikolay Kuznetsov (JIRA) wrote:
> Nikolay Kuznetsov commented on HARMONY-271:
> -------------------------------------------
> 
> Tim,
> 
> tank you very much for so such a quick response and integration. All the changes are in place as was expected.
> But there is one minor issue, affected files was somehow(svn commit, I believe) converted into dos format(line terminators was changed for entire files).
> It's not a problem itself, but svn diff shows that entire file was changed during this commit.

Yes, I saw that too, and I agree that it makes it virtually impossible
to see exactly what was changed.  I used a windows machine to apply your
patch and commit the code, so I can only assume that's why the file was
converted to DOS EOL.

I'll poke around to see if I can make it preserve the incoming EOL
convention.

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Re: EOL differences in svn diffs

Posted by Mark Hindess <ma...@googlemail.com>.
It would also be helpful to raise a bug against whatever tool Tim is
using.  It is almost certainly making incorrect assumptions about line
endings of files being patched based on eol characters of the
metadata.  Or possibly assuming the line endings of all files being
patched are the same which again is a bad assumption - see
moved.typos.diff attached to HARMONY-252 for example.

-Mark.

On 3/31/06, Geir Magnusson Jr <ge...@pobox.com> wrote:
> yes - eol-style is the solution here, and I thought SVN did the right
> thing for obvious text files...
>
> geir
>
>
> Archie Cobbs wrote:
> > Tim Ellison wrote:
> >> Can we set up the server to recognize .java / .xml / etc files as
> >> text/plain native types?
> >
> > Sounds good to me....
> >
> > $ find . -name \*.java -o -name \*.xml \
> >     | xargs svn propset svn:eol-style native \
> >   && svn ci -m "Set native EOL style"
> >
> >> Etienne Gagnon wrote:
> >>> Actually, you need to set 2 properties:
> >>>   svn:mime-type : text/plain
> >>>   svn:eol-style : native
> >
> > Hmm.. in my experience, only "svn:eol-style native" is required,
> > as by default subversion treats files as text files..
> >
> > -Archie
> >
> > __________________________________________________________________________
> > Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
> >
> >
>
>


--
Mark Hindess <ma...@googlemail.com>
IBM Java Technology Centre, UK.

Re: EOL differences in svn diffs

Posted by Geir Magnusson Jr <ge...@pobox.com>.
yes - eol-style is the solution here, and I thought SVN did the right 
thing for obvious text files...

geir


Archie Cobbs wrote:
> Tim Ellison wrote:
>> Can we set up the server to recognize .java / .xml / etc files as
>> text/plain native types?
> 
> Sounds good to me....
> 
> $ find . -name \*.java -o -name \*.xml \
>     | xargs svn propset svn:eol-style native \
>   && svn ci -m "Set native EOL style"
> 
>> Etienne Gagnon wrote:
>>> Actually, you need to set 2 properties:
>>>   svn:mime-type : text/plain
>>>   svn:eol-style : native
> 
> Hmm.. in my experience, only "svn:eol-style native" is required,
> as by default subversion treats files as text files..
> 
> -Archie
> 
> __________________________________________________________________________
> Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
> 
> 


Re: EOL differences in svn diffs

Posted by Etienne Gagnon <eg...@sablevm.org>.
Neat page!  Could a link to it be added to the Harmony web page, so that
new contributors, which are already overwhelmed by information, don't
forget to read it?  ;-)

Etienne

Leo Simons wrote:
> Please see http://www.apache.org/dev/, in particular

-- 
Etienne M. Gagnon, Ph.D.            http://www.info2.uqam.ca/~egagnon/
SableVM:                                       http://www.sablevm.org/
SableCC:                                       http://www.sablecc.org/

Re: EOL differences in svn diffs

Posted by Geir Magnusson Jr <ge...@pobox.com>.

Tim Ellison wrote:
> Ah, thanks Leo.
> 
> I've set up these options on my svn client so let's see if that fixes
> it.  Still seems strange that every client has to do this rather than
> making it a server-side config.

I think that's the cool thing - the server stores in platform neutral, 
and just mods when it comes down to the client.  I thought the same 
thing at first...

> 
> I assume that we need to slam all the existing files now.

I don't think so...  try it.

geir

> 
> Regards,
> Tim
> 
> Leo Simons wrote:
>> Please see http://www.apache.org/dev/, in particular
>>
>>   http://www.apache.org/dev/svn-eol-style.txt
>>
>> LSD
>>
>> On Fri, Mar 31, 2006 at 06:08:44AM -0500, Geir Magnusson Jr wrote:
>>> no, it should be able to be set that way once, I thought....
>>>
>>> Tim Ellison wrote:
>>>> Archie Cobbs wrote:
>>>>> Tim Ellison wrote:
>>>>>> Can we set up the server to recognize .java / .xml / etc files as
>>>>>> text/plain native types?
>>>>> Sounds good to me....
>>>>>
>>>>> $ find . -name \*.java -o -name \*.xml \
>>>>>    | xargs svn propset svn:eol-style native \
>>>>>  && svn ci -m "Set native EOL style"
>>>> Isn't there a server config file that will capture this? (or do we have
>>>> to run this as a daily cron job to label new files!)
>>>>
>>>> Regards,
>>>> Tim
>>>>
>>>>>> Etienne Gagnon wrote:
>>>>>>> Actually, you need to set 2 properties:
>>>>>>>  svn:mime-type : text/plain
>>>>>>>  svn:eol-style : native
>>>>> Hmm.. in my experience, only "svn:eol-style native" is required,
>>>>> as by default subversion treats files as text files..
>>>>>
>>>>> -Archie
>>>>>
>>>>> __________________________________________________________________________
>>>>> Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
>>>>>
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: EOL differences in svn diffs

Posted by Tim Ellison <t....@gmail.com>.
Ah, thanks Leo.

I've set up these options on my svn client so let's see if that fixes
it.  Still seems strange that every client has to do this rather than
making it a server-side config.

I assume that we need to slam all the existing files now.

Regards,
Tim

Leo Simons wrote:
> Please see http://www.apache.org/dev/, in particular
> 
>   http://www.apache.org/dev/svn-eol-style.txt
> 
> LSD
> 
> On Fri, Mar 31, 2006 at 06:08:44AM -0500, Geir Magnusson Jr wrote:
>> no, it should be able to be set that way once, I thought....
>>
>> Tim Ellison wrote:
>>> Archie Cobbs wrote:
>>>> Tim Ellison wrote:
>>>>> Can we set up the server to recognize .java / .xml / etc files as
>>>>> text/plain native types?
>>>> Sounds good to me....
>>>>
>>>> $ find . -name \*.java -o -name \*.xml \
>>>>    | xargs svn propset svn:eol-style native \
>>>>  && svn ci -m "Set native EOL style"
>>> Isn't there a server config file that will capture this? (or do we have
>>> to run this as a daily cron job to label new files!)
>>>
>>> Regards,
>>> Tim
>>>
>>>>> Etienne Gagnon wrote:
>>>>>> Actually, you need to set 2 properties:
>>>>>>  svn:mime-type : text/plain
>>>>>>  svn:eol-style : native
>>>> Hmm.. in my experience, only "svn:eol-style native" is required,
>>>> as by default subversion treats files as text files..
>>>>
>>>> -Archie
>>>>
>>>> __________________________________________________________________________
>>>> Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
>>>>
> 

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: EOL differences in svn diffs

Posted by Leo Simons <ma...@leosimons.com>.
Please see http://www.apache.org/dev/, in particular

  http://www.apache.org/dev/svn-eol-style.txt

LSD

On Fri, Mar 31, 2006 at 06:08:44AM -0500, Geir Magnusson Jr wrote:
> no, it should be able to be set that way once, I thought....
> 
> Tim Ellison wrote:
> >Archie Cobbs wrote:
> >>Tim Ellison wrote:
> >>>Can we set up the server to recognize .java / .xml / etc files as
> >>>text/plain native types?
> >>Sounds good to me....
> >>
> >>$ find . -name \*.java -o -name \*.xml \
> >>    | xargs svn propset svn:eol-style native \
> >>  && svn ci -m "Set native EOL style"
> >
> >Isn't there a server config file that will capture this? (or do we have
> >to run this as a daily cron job to label new files!)
> >
> >Regards,
> >Tim
> >
> >>>Etienne Gagnon wrote:
> >>>>Actually, you need to set 2 properties:
> >>>>  svn:mime-type : text/plain
> >>>>  svn:eol-style : native
> >>Hmm.. in my experience, only "svn:eol-style native" is required,
> >>as by default subversion treats files as text files..
> >>
> >>-Archie
> >>
> >>__________________________________________________________________________
> >>Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
> >>
> >

Re: EOL differences in svn diffs

Posted by Geir Magnusson Jr <ge...@pobox.com>.
no, it should be able to be set that way once, I thought....

Tim Ellison wrote:
> Archie Cobbs wrote:
>> Tim Ellison wrote:
>>> Can we set up the server to recognize .java / .xml / etc files as
>>> text/plain native types?
>> Sounds good to me....
>>
>> $ find . -name \*.java -o -name \*.xml \
>>     | xargs svn propset svn:eol-style native \
>>   && svn ci -m "Set native EOL style"
> 
> Isn't there a server config file that will capture this? (or do we have
> to run this as a daily cron job to label new files!)
> 
> Regards,
> Tim
> 
>>> Etienne Gagnon wrote:
>>>> Actually, you need to set 2 properties:
>>>>   svn:mime-type : text/plain
>>>>   svn:eol-style : native
>> Hmm.. in my experience, only "svn:eol-style native" is required,
>> as by default subversion treats files as text files..
>>
>> -Archie
>>
>> __________________________________________________________________________
>> Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
>>
> 

Re: EOL differences in svn diffs

Posted by Tim Ellison <t....@gmail.com>.
Archie Cobbs wrote:
> Tim Ellison wrote:
>> Can we set up the server to recognize .java / .xml / etc files as
>> text/plain native types?
> 
> Sounds good to me....
> 
> $ find . -name \*.java -o -name \*.xml \
>     | xargs svn propset svn:eol-style native \
>   && svn ci -m "Set native EOL style"

Isn't there a server config file that will capture this? (or do we have
to run this as a daily cron job to label new files!)

Regards,
Tim

>> Etienne Gagnon wrote:
>>> Actually, you need to set 2 properties:
>>>   svn:mime-type : text/plain
>>>   svn:eol-style : native
> 
> Hmm.. in my experience, only "svn:eol-style native" is required,
> as by default subversion treats files as text files..
> 
> -Archie
> 
> __________________________________________________________________________
> Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
> 

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Re: EOL differences in svn diffs

Posted by Archie Cobbs <ar...@dellroad.org>.
Tim Ellison wrote:
> Can we set up the server to recognize .java / .xml / etc files as
> text/plain native types?

Sounds good to me....

$ find . -name \*.java -o -name \*.xml \
     | xargs svn propset svn:eol-style native \
   && svn ci -m "Set native EOL style"

> Etienne Gagnon wrote:
>> Actually, you need to set 2 properties:
>>   svn:mime-type : text/plain
>>   svn:eol-style : native

Hmm.. in my experience, only "svn:eol-style native" is required,
as by default subversion treats files as text files..

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com

Re: EOL differences in svn diffs

Posted by Tim Ellison <t....@gmail.com>.
Can we set up the server to recognize .java / .xml / etc files as
text/plain native types?

Regards,
Tim

Etienne Gagnon wrote:
> The property works.  I has been in use in the SableVM repository for a
> long time now.
> 
> Actually, you need to set 2 properties:
>   svn:mime-type : text/plain
>   svn:eol-style : native
> 
> Note that svn will give you trouble if you try to set these properties
> on a file which contains mixed EOL types.
> 
> Etienne
> 
> Nikolay Kuznetsov wrote:
>> However, I tried to play with this switch on local machine (svn
>> client/local svn server) and this had no effect.
> 

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Re: EOL differences in svn diffs

Posted by Nikolay Kuznetsov <ni...@gmail.com>.
> Actually, you need to set 2 properties:
>  svn:mime-type : text/plain
>  svn:eol-style : native
It depends a lot from the svn client, though. I tried this, but in my
case files are returning from repository in the format they are stored
in repository.

Thanks a lot for the comment, I'll try to use another client.


Regards,
Nik

Re: EOL differences in svn diffs

Posted by Etienne Gagnon <eg...@sablevm.org>.
The property works.  I has been in use in the SableVM repository for a
long time now.

Actually, you need to set 2 properties:
  svn:mime-type : text/plain
  svn:eol-style : native

Note that svn will give you trouble if you try to set these properties
on a file which contains mixed EOL types.

Etienne

Nikolay Kuznetsov wrote:
> However, I tried to play with this switch on local machine (svn
> client/local svn server) and this had no effect.

-- 
Etienne M. Gagnon, Ph.D.            http://www.info2.uqam.ca/~egagnon/
SableVM:                                       http://www.sablevm.org/
SableCC:                                       http://www.sablecc.org/

Re: EOL differences in svn diffs

Posted by Nikolay Kuznetsov <ni...@gmail.com>.
> Yes, I saw that too, and I agree that it makes it virtually impossible
> to see exactly what was changed.  I used a windows machine to apply your
> patch and commit the code, so I can only assume that's why the file was
> converted to DOS EOL.
>
> I'll poke around to see if I can make it preserve the incoming EOL
> convention.

Subversion manual suggests the following:

"The solution to this problem is the svn:eol-style property. When this
property is set to a valid value, Subversion uses it to determine what
special processing to perform on the file so that the file's line
ending style isn't flip-flopping with every commit that comes from a
different operating system. The valid values are:
native/CR/LF/CRLF",

However, I tried to play with this switch on local machine (svn
client/local svn server) and this had no effect.

Currently I'm preparing next patch for regular expressions and it's
become a bit complicated (not too much, though:)). One has to preserve
line endings for particular file in patches, otherwise patch will not
work.

Regards,
Nik