Subversion EOL issue

12 posts
Subversion EOL issue

omalleypat
MMEX Developer

Posts: 175
Joined: Tue Jul 28, 2009 4:34 pm
Location: Atchison, KS
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:

Code: Select all
svn diff -c 649 util.cpp


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

Vadim
MMEX Developer

Posts: 159
Joined: Mon Aug 03, 2009 1:35 am
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

madhan
Site Admin

Posts: 242
Joined: Sun Nov 30, 2008 2:06 pm
Where is this configuration setup for TortoiseSVN in Windows?
Re: Subversion EOL issue

Vadim
MMEX Developer

Posts: 159
Joined: Mon Aug 03, 2009 1:35 am
%APPDATA%\Subversion\config for svn. I think this will be enough.
Re: Subversion EOL issue

Vadim
MMEX Developer

Posts: 159
Joined: Mon Aug 03, 2009 1:35 am
I have applied svn:eol-style for 0.9.5 branch (only to .cpp & .h sources in include and src).
Re: Subversion EOL issue

omalleypat
MMEX Developer

Posts: 175
Joined: Tue Jul 28, 2009 4:34 pm
Location: Atchison, KS
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

Vadim
MMEX Developer

Posts: 159
Joined: Mon Aug 03, 2009 1:35 am
Yes, you are right :-)
Re: Subversion EOL issue

omalleypat
MMEX Developer

Posts: 175
Joined: Tue Jul 28, 2009 4:34 pm
Location: Atchison, KS
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

Vadim
MMEX Developer

Posts: 159
Joined: Mon Aug 03, 2009 1:35 am
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

elliswr
MMEX Developer

Posts: 151
Joined: Tue May 05, 2009 2:21 am
Location: Granbury, TX
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.
Who is online

Users browsing this forum: No registered users and 13 guests