Page 1 of 2
Subversion EOL issue
Posted: Tue Oct 20, 2009 12:21 pm
by omalleypat
Wes and I bumped into a small issue last night that I think can be attributed to EOL (end-of-line) characters handling in subversion. I had noticed some wacky behavior with diff before but I finally figured it out. When I was making patches to send to Nikolay, there would frequently be lines that were reported as changed, but on looking at the diff, they appeared to be the same. I knew I didn't change those particular lines in the file, so I just deleted them from the diff for the patches. In Wes' last commit, the file /src/util.cpp was committed, even though he didn't really make any changes. Last night, I had a little ah-ha moment and decided to check the EOL characters. It turns out that it is due to differences in end-of-line characters used by XCode (Mac IDE) and some other editor used by one of the other developers. For example, if you run:
it will report a ton of changes, but it appears that nothing is really changed looking at the diff (the -c # option by the way is to do a diff based on what was changed for a specific revision number, in this case 649, in case anyone is unfamiliar). That is because the EOL character has changed. You can verify that it is EOL business by running:
Code: Select all
svn diff -c 649 -x --ignore-eol-style util.cpp
which will show no differences.
I propose we set the subversion EOL style property (I guess to "native") so we can stop this from being an issue. See this:
http://svnbook.red-bean.com/en/1.1/ch07s02.html (scroll down to svn:eol-style. I think this should solve our problem and prevent future superfluous commits from everyone.
Re: Subversion EOL issue
Posted: Wed Oct 21, 2009 1:54 pm
by Vadim
I've set svn:eol-style for trunk files.
Also good idea for developers who commit to svn modify theirs Subversion's config file and uncomment next lines for section
### 'enable-auto-props' option.
*.c = svn:eol-style=native
*.cpp = svn:eol-style=native
*.h = svn:eol-style=native
and for others files which use in MMEX
Re: Subversion EOL issue
Posted: Wed Oct 21, 2009 2:28 pm
by madhan
Where is this configuration setup for TortoiseSVN in Windows?
Re: Subversion EOL issue
Posted: Wed Oct 21, 2009 2:38 pm
by Vadim
%APPDATA%\Subversion\config for svn. I think this will be enough.
Re: Subversion EOL issue
Posted: Wed Oct 21, 2009 2:42 pm
by Vadim
I have applied svn:eol-style for 0.9.5 branch (only to .cpp & .h sources in include and src).
Re: Subversion EOL issue
Posted: Wed Oct 21, 2009 7:26 pm
by omalleypat
Vadim,
Good point. The Mac/Linux config file is at ~/.subversion/config. Just to clarify, you also need to uncomment the enable-autoprops=yes line itself. Mine looks like this:
Code: Select all
### Set enable-auto-props to 'yes' to enable automatic properties
### for 'svn add' and 'svn import', it defaults to 'no'.
### Automatic properties are defined in the section 'auto-props'.
enable-auto-props = yes
### Section for configuring automatic properties.
[auto-props]
### The format of the entries is:
### file-name-pattern = propname[=value][;propname[=value]...]
### The file-name-pattern can contain wildcards (such as '*' and
### '?'). All entries which match will be applied to the file.
### Note that auto-props functionality must be enabled, which
### is typically done by setting the 'enable-auto-props' option.
*.c = svn:eol-style=native
*.cpp = svn:eol-style=native
*.h = svn:eol-style=native
Re: Subversion EOL issue
Posted: Thu Oct 22, 2009 6:23 am
by Vadim
Yes, you are right

Re: Subversion EOL issue
Posted: Thu Oct 22, 2009 4:15 pm
by omalleypat
I was just poking around the repository for something unrelated and I found tools/eolfix.exe. Should we get rid of that? If it does what I think, it should be unnecessary.
Re: Subversion EOL issue
Posted: Fri Oct 23, 2009 6:58 am
by Vadim
Personally I did not use it at all. I have full suite of software from GnuWin32 which includes dos2unix & unix2dos. I think such programs as eolfix.exe unnecessary in svn and should be deleted. I added upx.exe only because it uses in our makefiles and thus must be always available.
Re: Subversion EOL issue
Posted: Mon Oct 26, 2009 3:06 am
by elliswr
Yeah, so note to self: If you are using Xcode for managing SVN, do not put native for the type. I don't know what to put yet, but making these changes to the subversion config file absolutely breaks SVN in Xcode 3.2.1
I'll update when I find out a fix.