You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Andrew Stitcher <as...@redhat.com> on 2008/12/04 18:24:20 UTC

C++ code has some confused line endings

Since the win32 port work was committed I've noticed that some (all?) of
the files touched have gained windows style line ending markers in some
places.

If you are working on the win32 port would you make sure that you have
svn configured so that it knows not to check in win32 style line endings
on changed lines as raw changes.

- What is supposed to happen is that the local svn client knows the
local line ending convention and converts on check out/check in. But
this seems to have been broken somehow in some of the files. At least
this is my understanding of how it's supposed to work.

Not a big deal, but untidy.

Andrew



Re: C++ code has some confused line endings

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday 04 December 2008 1:17:59 pm Daniel Kulp wrote:
> On Thursday 04 December 2008 1:08:01 pm Andrew Stitcher wrote:
> > If that is the case we need to make sure that *all* text files have the
> > attribute set (not just cpp ones).
>
> Yep.
>
> I've attached a script I've used for this in the past (requires gnu
> utilities, so probable linux required).

One more note: 
You can make svn add the property automatically when you run "svn add file" by 
updating your ~/.subversion/config file.

Turn on:
enable-auto-props = yes
in the [miscellany]

And then define a bunch of auto-props.   I've attached my config to use as an 
example.   Note that mine also sets mime types and such for some files.   
That allows a proper mime-type to be set if you browse the SVN repository 
with your browser.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: C++ code has some confused line endings

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday 04 December 2008 1:08:01 pm Andrew Stitcher wrote:
> On Thu, 2008-12-04 at 12:29 -0500, Daniel Kulp wrote:
> > Check the svn:eol-style attribute on the files:
> >
> > svn proplist FILE
> > svn propget svn:eol-style FILE
> >
> > If there isn't an svn:eol-style attribute, svn won't touch it.    You
> > might want to do something like:
>
> Does "won't touch it" mean that the line endings won't be changed at all
> without the property set?

Right.   Without that propery, according to svn, it's a binary file and it 
won't do any type of cr/lf translation.


> If that is the case we need to make sure that *all* text files have the
> attribute set (not just cpp ones).

Yep.

I've attached a script I've used for this in the past (requires gnu utilities, 
so probable linux required).

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog


Re: C++ code has some confused line endings

Posted by Andrew Stitcher <as...@redhat.com>.
On Thu, 2008-12-04 at 12:29 -0500, Daniel Kulp wrote:
> Check the svn:eol-style attribute on the files:
> 
> svn proplist FILE
> svn propget svn:eol-style FILE
> 
> If there isn't an svn:eol-style attribute, svn won't touch it.    You might 
> want to do something like:

Does "won't touch it" mean that the line endings won't be changed at all
without the property set?

If that is the case we need to make sure that *all* text files have the
attribute set (not just cpp ones).

Andrew



Re: C++ code has some confused line endings

Posted by Daniel Kulp <dk...@apache.org>.
Check the svn:eol-style attribute on the files:

svn proplist FILE
svn propget svn:eol-style FILE

If there isn't an svn:eol-style attribute, svn won't touch it.    You might 
want to do something like:

find . -name "*.cpp" -exec svn propset svn:eolstyle native {} \;

or something to make sure it gets set everywhere.

Dan




On Thursday 04 December 2008 12:24:20 pm Andrew Stitcher wrote:
> Since the win32 port work was committed I've noticed that some (all?) of
> the files touched have gained windows style line ending markers in some
> places.
>
> If you are working on the win32 port would you make sure that you have
> svn configured so that it knows not to check in win32 style line endings
> on changed lines as raw changes.
>
> - What is supposed to happen is that the local svn client knows the
> local line ending convention and converts on check out/check in. But
> this seems to have been broken somehow in some of the files. At least
> this is my understanding of how it's supposed to work.
>
> Not a big deal, but untidy.
>
> Andrew



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

RE: C++ code has some confused line endings

Posted by Steve Huston <sh...@riverace.com>.
Hi Andrew,

> Since the win32 port work was committed I've noticed that 
> some (all?) of
> the files touched have gained windows style line ending 
> markers in some places.

Hmmm...

> If you are working on the win32 port would you make sure that you
have
> svn configured so that it knows not to check in win32 style 
> line endings on changed lines as raw changes.

That's primarily me, and I was pretty careful about this when merging.
I apologize for errors. I thought that svn traits defined the
behavior, but I'm not an expert. If an svn wiz can let me know what is
the right thing to do here, I'll take care of it.

The Visual Studio solution/project files must go in and stay with DOS
line endings so that when a Linux host builds a kit that's downloaded
and used on Windows, Visual Studio can identify them correctly.

> - What is supposed to happen is that the local svn client knows the
> local line ending convention and converts on check out/check in. But
> this seems to have been broken somehow in some of the files. At
least
> this is my understanding of how it's supposed to work.
> 
> Not a big deal, but untidy.

Absolutely... I'll fix problems that I can find. If anyone has
particulars, feel free to send me file names.

-Steve