You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Simon Kitching <sk...@obsidium.com> on 2005/11/24 02:34:22 UTC

SVN and eol-style: native

Hi,

I've recently fixed a couple of files without any svn:eol-style setting 
and it has generated big diffs.

I think what's happening is that when svn:eol-style gets set on a file 
that didn't have it, the file gets "normalised" before committing. And 
normalisation happens to mean "convert to unix style". So if the file 
was originally committed without svn:eol-style, but from a unix machine, 
then setting svn:eol-style doesn't cause any diffs. If the file was 
originally committed from a Windows machine (or Mac), however, then 
every line in the file gets updated :-(.

I'll therefore stop adding svn:eol-style props to files. The nuisance of 
the diff is greater than the gain I think; unix users can live with the 
occasional "^M" appearing in their editors, and most Windows editors can 
handle unix line-endings these days (except Notepad!).

But it would be great if people could check that their svn "auto props" 
are set to add svn:eol-style on new files.

Regards,

Simon

Re: SVN and eol-style: native

Posted by Martin Cooper <ma...@apache.org>.
On 11/23/05, Wendy Smoak <ws...@gmail.com> wrote:
>
> On 11/23/05, Simon Kitching <sk...@obsidium.com> wrote:
>
> > So if the file
> > was originally committed without svn:eol-style, but from a unix machine,
> > then setting svn:eol-style doesn't cause any diffs. If the file was
> > originally committed from a Windows machine (or Mac), however, then
> > every line in the file gets updated :-(.
>
> You've got it!  Ask the person who committed 10k lines of tld files to
> Struts with Windows line endings about the commit message that ran
> nine emails long when it had to be fixed.
>
> > I'll therefore stop adding svn:eol-style props to files. The nuisance of
> > the diff is greater than the gain I think;
>
> IMO it would be better to fix them and get it over with.  Once they
> have the 'native' eol style  then it doesn't matter who edits them.


+1. Definitely. If you leave a mixture of line ends, particularly in Java
source files, you can get into a mess when you're trying to debug. The stack
trace may give you a line number that doesn't match the sources you're
looking at. That's a serious pain.

--
Martin Cooper


Here's what I came up with to run a directory tree and set the svn
> props we use:
>
> svn ls -R | grep '\.java$' | xargs -i svn propset svn:eol-style native
> '{}'
> svn ls -R | grep '\.java$' | xargs -i svn propset svn:keywords "Date
> Author Id Revision HeadURL" '{}'
>
> (Then I do the same thing for all the other file types.  Inefficient,
> I know. :)  Can someone improve it and make it do '.java or .tld or
> .html or .xml' ? And does it really say 'ends with .java' or did I get
> that wrong?)
>
> After that, it's just a matter of watching the commit messages for new
> files committed without props and reminding people to fix their
> settings, and occasional cleanup.
>
> HTH,
> --
> Wendy
>

Re: SVN and eol-style: native

Posted by Mike Kienenberger <mk...@gmail.com>.
On 11/23/05, Wendy Smoak <ws...@gmail.com> wrote:
> IMO it would be better to fix them and get it over with.  Once they
> have the 'native' eol style  then it doesn't matter who edits them.

+1  -- it's got to happen eventually, and the sooner it's done, the
better.   If possible, it'd be best to commit this eol fix for each
broken file by itself rather than waiting to fix them "as you go." 
That way, non-cosmetic changes won't get lost in the eol changes. 
Unfortunately, I'm not volunteering :)

Re: SVN and eol-style: native

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/23/05, Simon Kitching <sk...@obsidium.com> wrote:

> So if the file
> was originally committed without svn:eol-style, but from a unix machine,
> then setting svn:eol-style doesn't cause any diffs. If the file was
> originally committed from a Windows machine (or Mac), however, then
> every line in the file gets updated :-(.

You've got it!  Ask the person who committed 10k lines of tld files to
Struts with Windows line endings about the commit message that ran
nine emails long when it had to be fixed.

> I'll therefore stop adding svn:eol-style props to files. The nuisance of
> the diff is greater than the gain I think;

IMO it would be better to fix them and get it over with.  Once they
have the 'native' eol style  then it doesn't matter who edits them. 
Here's what I came up with to run a directory tree and set the svn
props we use:

svn ls -R | grep '\.java$' | xargs -i svn propset svn:eol-style native '{}'
svn ls -R | grep '\.java$' | xargs -i svn propset svn:keywords "Date
Author Id Revision HeadURL" '{}'

(Then I do the same thing for all the other file types.  Inefficient,
I know. :)  Can someone improve it and make it do '.java or .tld or
.html or .xml' ? And does it really say 'ends with .java' or did I get
that wrong?)

After that, it's just a matter of watching the commit messages for new
files committed without props and reminding people to fix their
settings, and occasional cleanup.

HTH,
--
Wendy