You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Giulio Troccoli <Gi...@uk.linedata.com> on 2006/10/26 11:17:52 UTC
Visual Studio and the svn:eol-style property
First of all let me say that this might not be the correct Forum, but I
couldn't find a better one (you'll understand in a minute).
Secondly, I have searched all forums but I haven't find any post about
my problem.
We have Subversion on a Linux box, but we develop on Solaris, Linux and
Windows.
Recently the Solaris build failed because there were some CR-LF at the
end on some lines, inserted by Visual Studio (the tools we use to
develop on Windows along with TortoiseSVN).
I read the Subversion Manual and set the svn:eol-style property to
native to all files. It seems that everything was fine, i.e. I could
build on all three platforms.
Unfortunately the next time we tried to commit some changes in Windows,
the pre-commit script failed saying
Error Commit failed (details follow):
Error File 'blah blah blah' has inconsistent newlines
Error Inconsistent line ending style
This was caused, I think, by copy-and-paste, but still it is something
that I would like to avoid.
I thought that setting the svn:eol-style property to native would
automatically translate any kind of eol to the native eol only when the
code was checked-out or updated. But clearly I'm wrong on this.
So now, what I would like to achieve is a system were no matter the
file's eol style when it is committed, its eol style is correct for the
platform where the file is checked-out or updated.
I also thought of using dos2unix utility. My problem with that, and
please advise of this too, is that using a working copy to do the build
we would need to dos2unix every file before starting the build. We
cannot just dos2unix a single file before compiling it as we would miss
on the .h files.
This solution not only would have a performance impact, in respect of
doing something with Subversion directly, e.g. using svn:eol-style
property, but also would put the working copy in a "modify" state, so
next time we update it before building Subversion will merge the
repository copy with our changes, which are only the eols. We cannot
take the risk of having conflicts as these are all automatic processes.
I hope I was enough clear in my explanation. If I wasn't please ask.
Thanks
Giulio
-------------------
Giulio Troccoli
Technical Consultant
Linedata Services (UK) Ltd. Bishopsgate Court, 4-12 Norton Folgate,
London E1 6DB
T +44 (0)20 7360 1914 F +44 (0)20 7360 1974
E giulio.troccoli@uk.linedata.com
<ma...@uk.linedata.com> W www.linedata.com
<http://www.linedata.com>
MSN Messenger giulio@troccoli.it
Re: Visual Studio and the svn:eol-style property
Posted by Ted Dennison <de...@ssd.fsi.com>.
Giulio Troccoli wrote:
> Unfortunately I don't think my company would be keen to "force"
> developers to use a 3rd party editor. And also I would like to find a
> more robust solution, if there is one, which doesn't rely on developers'
> choices.
>
I understand. However, they are already "forcing" use of VisualStudio on
Windows, are they not? Its fairly common for an organization to have a
standard set of VisualStudio Addins that are part of every install.
You may well find another solution that will work for you, and if so,
wonderful. However, the root of the problem here seems to be the crappy
editor that your Windows users are using. So why not attack the root of
the problem? This *won't* be the only issue that the VS editor is
causing either. I'll venture a guess that these cross-edited files are
also having trouble with the tabs that VisualStudio loves to insert
everywhere. This renders the code nigh-unreadable in another editor with
different tab stops. Perhaps your post-processing script will end up
having to fix those too. In fact, there's probably a way to make a VS
addin that does both whenever a file is saved.
--
T.E.D. Work - mailto:dennison@ssd.fsi.com
Home - mailto:dennison@telepath.com (Yahoo: Ted_Dennison)
Homepage - http://www.telepath.com/~dennison/Ted/TED.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: Visual Studio and the svn:eol-style property
Posted by Giulio Troccoli <Gi...@uk.linedata.com>.
Thanks Ted.
You mean choosing a different editor to be used inside Visual Studio? I
didn't even know it was possible, I personally stay well away from
Windows if I can.
Unfortunately I don't think my company would be keen to "force"
developers to use a 3rd party editor. And also I would like to find a
more robust solution, if there is one, which doesn't rely on developers'
choices.
Giulio
-----Original Message-----
From: Ted Dennison [mailto:dennison@ssd.fsi.com]
Sent: 26 October 2006 15:24
To: Giulio Troccoli
Cc: users@subversion.tigris.org
Subject: Re: Visual Studio and the svn:eol-style property
Giulio Troccoli wrote:
> I also thought of using dos2unix utility. My problem with that, and
> please advise of this too, is that using a working copy to do the
build
> we would need to dos2unix every file before starting the build. We
> cannot just dos2unix a single file before compiling it as we would
miss
> on the .h files.
>
Have you considered using a 3rd party editor with VisualStudio? The
VisualStudio editor kinda sux. I know Emacs can handle this situation
(it detects the line ending style when the file is loaded, and uses
that). I don't know about others like CodeWrite, but any other serious
programmers editor should support most of Emacs's text editing features
(or they should have bagged the whole effort and repackaged emacs).
NTemacs is available at ftp://ftp.gnu.org/gnu/emacs/windows/, and the
VisualStudio addin I use is at
http://www.atnetsend.net/computing/VisEmacs/
--
T.E.D. Work - mailto:dennison@ssd.fsi.com
Home - mailto:dennison@telepath.com (Yahoo: Ted_Dennison)
Homepage - http://www.telepath.com/~dennison/Ted/TED.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Visual Studio and the svn:eol-style property
Posted by Ted Dennison <de...@ssd.fsi.com>.
Giulio Troccoli wrote:
> I also thought of using dos2unix utility. My problem with that, and
> please advise of this too, is that using a working copy to do the build
> we would need to dos2unix every file before starting the build. We
> cannot just dos2unix a single file before compiling it as we would miss
> on the .h files.
>
Have you considered using a 3rd party editor with VisualStudio? The
VisualStudio editor kinda sux. I know Emacs can handle this situation
(it detects the line ending style when the file is loaded, and uses
that). I don't know about others like CodeWrite, but any other serious
programmers editor should support most of Emacs's text editing features
(or they should have bagged the whole effort and repackaged emacs).
NTemacs is available at ftp://ftp.gnu.org/gnu/emacs/windows/, and the
VisualStudio addin I use is at http://www.atnetsend.net/computing/VisEmacs/
--
T.E.D. Work - mailto:dennison@ssd.fsi.com
Home - mailto:dennison@telepath.com (Yahoo: Ted_Dennison)
Homepage - http://www.telepath.com/~dennison/Ted/TED.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org