You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Hudson <gh...@MIT.EDU> on 2003/03/11 20:23:09 UTC

Re: eol style differences

(I wish there were a mail archive of this list which kept message IDs,
so I could generate proper responses after accidentally deleting the
mail I want to respond to.)

Branko wrote:
> Whichever code it is, it's doing the wrong thing. The text base
> should be converted to WC style, not the other way around, otherwise
> you won't notice newline-only changes.

> Oh, duh -- that would make keyword expansions cause problems for us
> again. What a bore.

This just means we have to parameterize the keyword expansion code so
that we can say "expand this text base with the same substitutions as
we used on the working copy."

> Hmm, maybe the conversion from WC style to text-base style should
> notice if the WC file line endings aren't consistent with what's
> declared in svn:eol-style?

I think it used to, but we turned that check off for everything but
"svn commit" after someone complained that it was difficult to recover
from having inconsistent newlines.  You couldn't even "svn revert" at
that time, which was really bad, but you also couldn't "svn diff" to
find out where your problem was.  Of course, it sounds like now, you
can successfully "svn diff", but it won't tell you where your problem
is.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: eol style differences

Posted by Branko Čibej <br...@xbc.nu>.
Greg Hudson wrote:

>On Tue, 2003-03-11 at 16:32, Sander Striker wrote:
>  
>
>>>We can, but I think the point is to avoid the complexity of translating
>>>keywords one way and newlines the other.  We can translate them both
>>>from base-style to wc-style as long as we make sure to use the same
>>>keyword translations as we used for the current wc copy.
>>>      
>>>
>>Wouldn't that screw up context in diffs? [it might contain the expanded
>>keywords]
>>    
>>
>
>That depends on whether you think it's "screwed up" to have an expanded
>keyword in the context.
>
>Certainly, if you produce a context diff and then try to apply it to a
>different working copy, you'll get a conflict.  But a collapsed keyword
>would also generate a conflict.
>  
>
Right. What we should try to avoid is diffs caused by different
keywords, but we can't do anything if the keywords are in the context of
another diff.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: eol style differences

Posted by Sander Striker <st...@apache.org>.
> From: Greg Hudson [mailto:ghudson@MIT.EDU]
> Sent: Tuesday, March 11, 2003 10:37 PM

> On Tue, 2003-03-11 at 16:32, Sander Striker wrote:
>> Wouldn't that screw up context in diffs? [it might contain the expanded
>> keywords]
> 
> That depends on whether you think it's "screwed up" to have an expanded
> keyword in the context.

I don't care ;)

> Certainly, if you produce a context diff and then try to apply it to a
> different working copy, you'll get a conflict.  But a collapsed keyword
> would also generate a conflict.

Hmmm, true.  Either way gives a conflict, and given we don't have an internal
patch to handle this...  disregard my comment.  Your suggestion seems the
way to go.

Sander


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: eol style differences

Posted by Greg Hudson <gh...@MIT.EDU>.
On Tue, 2003-03-11 at 16:32, Sander Striker wrote:
> > We can, but I think the point is to avoid the complexity of translating
> > keywords one way and newlines the other.  We can translate them both
> > from base-style to wc-style as long as we make sure to use the same
> > keyword translations as we used for the current wc copy.
> 
> Wouldn't that screw up context in diffs? [it might contain the expanded
> keywords]

That depends on whether you think it's "screwed up" to have an expanded
keyword in the context.

Certainly, if you produce a context diff and then try to apply it to a
different working copy, you'll get a conflict.  But a collapsed keyword
would also generate a conflict.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: eol style differences

Posted by Sander Striker <st...@apache.org>.
> From: Greg Hudson [mailto:ghudson@MIT.EDU]
> Sent: Tuesday, March 11, 2003 9:30 PM

> On Tue, 2003-03-11 at 15:26, Sander Striker wrote:
> > > This just means we have to parameterize the keyword expansion code so
> > > that we can say "expand this text base with the same substitutions as
> > > we used on the working copy."
> > 
> > We can simply translate the working copy to collapsed keywords.  That
> > is already part of the API.
> 
> We can, but I think the point is to avoid the complexity of translating
> keywords one way and newlines the other.  We can translate them both
> from base-style to wc-style as long as we make sure to use the same
> keyword translations as we used for the current wc copy.

Wouldn't that screw up context in diffs? [it might contain the expanded
keywords]

Sander


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: eol style differences

Posted by Greg Hudson <gh...@MIT.EDU>.
On Tue, 2003-03-11 at 15:26, Sander Striker wrote:
> > This just means we have to parameterize the keyword expansion code so
> > that we can say "expand this text base with the same substitutions as
> > we used on the working copy."
> 
> We can simply translate the working copy to collapsed keywords.  That
> is already part of the API.

We can, but I think the point is to avoid the complexity of translating
keywords one way and newlines the other.  We can translate them both
from base-style to wc-style as long as we make sure to use the same
keyword translations as we used for the current wc copy.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: eol style differences

Posted by Michael Price <mp...@atl.lmco.com>.
Karl Fogel writes:
 > "Jack Repenning" <jr...@collab.net> writes:
 > > > I also do this thing called "testing" 
 > > > whereby I notice problems in code.
 > > 
 > > Gee, did I come across this offensive?  I apologize!
 > 
 > No, you certainly didn't, Jack.

Well I guess we disagree then.

Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: eol style differences

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
"Jack Repenning" <jr...@collab.net> writes:
> > I also do this thing called "testing" 
> > whereby I notice problems in code.
> 
> Gee, did I come across this offensive?  I apologize!

No, you certainly didn't, Jack.

Folks, please remember the email amplification rule: any tiny bit of
sarcasm you put in your mail is amplified by a factor of 10 when the
reader sees it.  The amplification is inherent in phosphor and LCD
screens, it cannot be turned down in software.  Therefore, adjust
original content accordingly.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: eol style differences

Posted by Jack Repenning <jr...@collab.net>.
Michael Price:
> Well, I don't know about everyone else, but I've passed the 
> '-w' flag to diff so often that I now type it without even 
> thinking. ...
> me:
> > Edit much Python?
> Yep. I use a good editor (emacs) which has a mode to handle 
> indentation for me. 

Of course, I should have asked "_diff_ much Python?"  In any case, what
I guess you're saying is, "I use tools that do what I want, or at the
least have options that let me do what I want."  Glad to hear it.  Not
eveyone is so successful, or so motivated to learn their tools.  Some
would even like the "do what I want" thing to happen in their version
control tool, so they had more freedom in choosing their editors,
differs, and compilers.

> I also do this thing called "testing" 
> whereby I notice problems in code.

Gee, did I come across this offensive?  I apologize!

RE: eol style differences

Posted by Michael Price <mp...@atl.lmco.com>.
Jack Repenning writes:
 > Michael Price:
 > > Well, I don't know about everyone else, but I've passed the 
 > > '-w' flag to diff so often that I now type it without even 
 > > thinking.
 > 
 > Edit much Python, do you?  Python whitespace (indentation) is
 > meaningful, and "diff -w" misses substantive changes.

Yep. I use a good editor (emacs) which has a mode to handle indentation
for me. I also do this thing called "testing" whereby I notice problems
in code.

 > In any language, whitespace is meaningful in some contexts, as for
 > example inside strings.

Gee, really? Thanks for the info.

Michael Price               Member of the Engineering Staff
Distributed Processing Lab; Lockheed Martin Adv. Tech. Labs
A&E 3W; 1 Federal Street; Camden, NJ 08102
856-338-4021, fax 856-338-4144  email: mprice@atl.lmco.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: eol style differences

Posted by Jack Repenning <jr...@collab.net>.
Michael Price:
> Well, I don't know about everyone else, but I've passed the 
> '-w' flag to diff so often that I now type it without even 
> thinking.

Edit much Python, do you?  Python whitespace (indentation) is
meaningful, and "diff -w" misses substantive changes.

In any language, whitespace is meaningful in some contexts, as for
example inside strings.

Re: eol style differences

Posted by Michael Price <mp...@atl.lmco.com>.
Philip Martin writes:
 > Branko ,AD�(Bibej <br...@xbc.nu> writes:
 > > The intent of svn:eol-style was to get coherent results (diffs, that
 > > is) when people use all those editors out there that can't preserve
 > > the eol style.

Well, I don't know about everyone else, but I've passed the '-w' flag to
diff so often that I now type it without even thinking. That way I never
have to care about what broken editor (or broken source) I'm using at
the moment.

 > You say "all those editors", are there lots of them?  I find it hard
 > to imagine using such a tool.  Do they change anything else?  Spaces
 > to tabs, say, or trailing whitespace?

I've found that shareware Windows text editors are the big
offenders. However, in some cases the whitespace munging (not eol
conversion) is intentional. My default emacs setup uses whitespace mode
to auto-cleanup all whitespace issues. Pretty much every file in the
subversion source tree has trailing whitespace after one or more
lines. So I always have to use the '-w' flag for diff before sending in
patches.

I'd happily fix all of the whitespace issues in the subversion tree in
one giant whitespace cleanup commit but every subsequent commit would
just add more trailing whitespace (because of the brain-dead editors
that *don't* fix whitespace in source code) so its rather pointless.

 > Do we have any real-life examples where svn:eol-style fixes a problem?
 > Why should it be Subversion's job to solve this problem anyway?

I have often wondered that myself.

Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: eol style differences

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Philip Martin <ph...@codematters.co.uk> writes:
> That could be a problem.  So my next question applies: how often does
> it occur in real-life?  How often does a developer use a brain-damaged
> editor in a mixed Unix/Windows C development environment?

I can only offer anecdotal evidence (though some of it is documented
in this list's archives): it happens all the time.  On a project with
many developers/writers/authors/whatever, there will eventually be
someone who uses an insensitive editor in the wrong environment.

> Will they notice if we don't do it?  Perhaps we just need to "educate"
> them?

I believe that strategy has been shown not to work.

We didn't do it, and people noticed.  When Subversion didn't have EOL
conversion, people noticed and complained (that's the part about some
of the evidence being in this list's archives).  Educating the person
who complains doesn't help -- they're often not the person who used
the clobbery editor, they're just the person who detected the problem
afterwards.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: eol style differences

Posted by Philip Martin <ph...@codematters.co.uk>.
Branko Čibej <br...@xbc.nu> writes:

> >Even if there are (Windows?) editors that, say, accept LF line endings
> >and write CRLF line endings, is that a big problem?  After the first
> >checkin, the one that translates the file, subsequent checkins aren't
> >really a problem.  Or are we attempting to handle scenarios where
> >there are two broken editors, one doing LF-to-CRLF and the other doing
> >CRLF-to-LF?  How likely is that?
> >
> In any environment where you're editing on more than one platform.

No, editing on more than one platform is not enough.  I've done that.
You also need *broken editors* on more than one platform.  How likely
is that?

> I expect most Unix editors write just \n, again regardless of the
> prevailing style.

I've used half-a-dozen flavours of Unix and I've never had an editor
do that, unless I asked it to do it.

> The result is a mess.
> 
> Not to mention many, many Unix C compilers that will turn a blind eye to
> line continuation if they happen to see backslash-CR-LF.

That could be a problem.  So my next question applies: how often does
it occur in real-life?  How often does a developer use a brain-damaged
editor in a mixed Unix/Windows C development environment?

> >Do we have any real-life examples where svn:eol-style fixes a problem?
> >Why should it be Subversion's job to solve this problem anyway?
> >  
> Because that's what people expect of a cross-platform version management
> tool. Sad, but true.

Will they notice if we don't do it?  Perhaps we just need to "educate"
them?

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: eol style differences

Posted by Branko Čibej <br...@xbc.nu>.
Philip Martin wrote:

>Branko ÄŒibej <br...@xbc.nu> writes:
>  
>
>Huh?  Isn't that an example of eol-conversion being a bad thing?  If
>the CVS repository files were in the correct format, and got copied
>unchanged into the tarball, it would just work.
>
svn:eol-style isn't just about EOL *conversion*. It's also about
asserting a particular EOL style. "native" is just one of the possible
values.

>I think eol conversion is a patently ridiculous thing for a version
>control system to do.  However, it looks like I'll just have to live
>with it.
>  
>
I agree that it's not strictly the version control system's job, but
experience shows that we have to do something. Up to now, I think that
we at least got the design better than CVS (or ClearCase) does. I agree
there are still edge cases, most of which (I think) we see because a
propset on the svn:eol-style prop isn't treated as a text change.

As for non-Subversion clients -- Well, by default, we don't do
*anything* with line endings. So if you expect to use
non-svn:eol-style-aware clients, don't use svn:eol-style. It's not as if
we're forcing people to use this feature.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: eol style differences

Posted by Philip Martin <ph...@codematters.co.uk>.
Branko Čibej <br...@xbc.nu> writes:

> Oh, and I'd mention all those broken file formats (such as .dsp files)
> that absolutely insist on a certain style of line endings. It's way
> simpler to say svn:eol-style=CRLF than wonder if you've done the right
> thing every time you roll a tarball on a Unix machine.

Is that better than simply having the correct file in the repository
and then having it transferred unchanged into the tarball?  That's how
we worked under ClearCase the last time I worked on a Unix/Windows
project.  I have edited .dsp and .dsw files in vi on Unix, it's not
hard (one needs CRLF, the other doesn't as I recall).

> Observe that APR and httpd, which don't use Subversion and refuse to set
> the -kb flag on the .dsp files, have separate tarballs for Unix and
> Windows -- a situation which, to my taste, it a lot more horrible than
> trying to get svn:eol-style to work.

Huh?  Isn't that an example of eol-conversion being a bad thing?  If
the CVS repository files were in the correct format, and got copied
unchanged into the tarball, it would just work.

I think eol conversion is a patently ridiculous thing for a version
control system to do.  However, it looks like I'll just have to live
with it.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: eol style differences

Posted by Branko Čibej <br...@xbc.nu>.
Branko Čibej wrote:

>Philip Martin wrote:
>  
>
>>Do we have any real-life examples where svn:eol-style fixes a problem?
>>Why should it be Subversion's job to solve this problem anyway?
>>    
>>
>Because that's what people expect of a cross-platform version management
>tool. Sad, but true.
>  
>

Oh, and I'd mention all those broken file formats (such as .dsp files)
that absolutely insist on a certain style of line endings. It's way
simpler to say svn:eol-style=CRLF than wonder if you've done the right
thing every time you roll a tarball on a Unix machine.

Observe that APR and httpd, which don't use Subversion and refuse to set
the -kb flag on the .dsp files, have separate tarballs for Unix and
Windows -- a situation which, to my taste, it a lot more horrible than
trying to get svn:eol-style to work.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: eol style differences

Posted by Branko Čibej <br...@xbc.nu>.
Philip Martin wrote:

>Branko ÄŒibej <br...@xbc.nu> writes:
>
>  
>
>>The intent of svn:eol-style was to get coherent results (diffs, that
>>is) when people use all those editors out there that can't preserve
>>the eol style.
>>    
>>
>
>You say "all those editors", are there lots of them?  I find it hard
>to imagine using such a tool.
>
Sadly, such things exist, especially in the Windows world. But even
worse, most editors on Windows will blindly use \r\n, regardless of the
prevailing style in the file.

>Do they change anything else?  Spaces to tabs, say, or trailing whitespace?
>
Such things happen, too, but are less common.

>Even if there are (Windows?) editors that, say, accept LF line endings
>and write CRLF line endings, is that a big problem?  After the first
>checkin, the one that translates the file, subsequent checkins aren't
>really a problem.  Or are we attempting to handle scenarios where
>there are two broken editors, one doing LF-to-CRLF and the other doing
>CRLF-to-LF?  How likely is that?
>
In any environment where you're editing on more than one platform. I
expect most Unix editors write just \n, again regardless of the
prevailing style. The result is a mess.

Not to mention many, many Unix C compilers that will turn a blind eye to
line continuation if they happen to see backslash-CR-LF.

>Do we have any real-life examples where svn:eol-style fixes a problem?
>Why should it be Subversion's job to solve this problem anyway?
>  
>
Because that's what people expect of a cross-platform version management
tool. Sad, but true.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: eol style differences

Posted by Jack Repenning <jr...@collab.net>.
Philip Martin
> You say "all those editors", are there lots of them? 

There used to be more than there are today.  Say, ten years ago, nearly
every editor did something ugly about surprise line endings, and nearly
every compiler simply barfed and died.  Even the blessed Emacs only
learned to be line-ending agile in v.19.

I'd agree it was time to review whether this is still necessary, only I
saw line endings kill off a compiler within the last six months.  Not
quite a thing of the past, I'm afraid.


Re: eol style differences

Posted by Philip Martin <ph...@codematters.co.uk>.
Branko Čibej <br...@xbc.nu> writes:

> The intent of svn:eol-style was to get coherent results (diffs, that
> is) when people use all those editors out there that can't preserve
> the eol style.

You say "all those editors", are there lots of them?  I find it hard
to imagine using such a tool.  Do they change anything else?  Spaces
to tabs, say, or trailing whitespace?

Even if there are (Windows?) editors that, say, accept LF line endings
and write CRLF line endings, is that a big problem?  After the first
checkin, the one that translates the file, subsequent checkins aren't
really a problem.  Or are we attempting to handle scenarios where
there are two broken editors, one doing LF-to-CRLF and the other doing
CRLF-to-LF?  How likely is that?

Do we have any real-life examples where svn:eol-style fixes a problem?
Why should it be Subversion's job to solve this problem anyway?

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: eol style differences

Posted by Branko Čibej <br...@xbc.nu>.
Philip Martin wrote:

>brane@xbc.nu writes:
>
>  
>
>>>Using working copy style might be better most of the time (I'm not
>>>really convinced but I'll just assume it is for now), but it's not
>>>clear to me that it is always better.  Two problems come to mind.
>>>First, suppose one is comparing two different revisions, using '-rX'
>>>or '-rX:Y', then there will be two svn:eol-styles and they may not be
>>>the same.  Does each revision of the file get translated according to
>>>it's own svn:eol-style, or does one svn:eol-style get used for both?
>>>      
>>>
>>I'd propose two things: a) always use the svn:eol-style that's on the version
>>your'e looking at;
>>    
>>
>
>  $ svn st -v foo.c
>         5    5    philip   foo.c
>  $ svn diff -r3:4 foo.c
>
>Which is "the version you're looking at",  3, 4 or 5?
>
3 and 4; that's what it says, -r3:4

>Now consider the case without a working copy
>
>  $ svn diff -r3:4 http://server/repo/foo.c
>
>3 or 4?
>
Again, both 3 and 4

>Now consider merge
>
>  $ svn merge -r3:4 foo.c foo.c
>
>3, 4 or 5?
>
All three.

>>and b) remove all keytword expansions when doing diffs. Our internal
>>diff lib can do that on-the-fly; for an external diff, we have to
>>munge the WC file, too. Sigh.
>>
>>    
>>
>>>The second problem is more to do with how svn:eol-style works in
>>>general.  It is possible to have a repository format file with CRLF
>>>line-endings and svn:eol-style set to native.
>>>      
>>>
>>That's not how svn:eol-style works; that's how svn:eol-style
>>*does't* work. It's a bug, right?
>>    
>>
>
>I agree svn:eol-style doesn't work :)  I would describe the current
>behaviour as "haphazard".
>
My point exactly. .-)

>>Oh. What if you change svn:eol-style on a URL? Wheee...
>>    
>>
>
>The client doesn't let you use propset on an URL, not yet anyway.
>
Ah, right. A gleam of hope there.

>That is the basic problem though, svn:eol-style is enforced in the
>client (by libsvn_wc I think) and so not all clients will do it.  I
>think the following is a likely failure mode: a file has svn:eol-style
>set to native and a generic WebDAV client on Windows is used to commit
>a version of the file with CRLF endings.
>
Well, we really can't do anything about that. Except if we started
converting eol style on the server, which nightmare I shy away in horror
from.

>>>On Windows a repository
>>>format comparison should show every line changed, a working copy
>>>comparison should show no change.  Which is correct?
>>>      
>>>
>>Actually, if you convert the pristine copy, you'll see no change on Unix, too.
>>Which is bad, because then you'll commit the "no change" and be delightfully
>>surprised at having changed every line ending in the repo. Oh, duh.
>>    
>>
>
>So we just drop svn:eol-style as a mistake?  It's not just Subversion,
>the last time I used ClearCase on a Windows/Unix project we stopped
>using ClearCase's eol conversion, it didn't do the right thing as far
>as we were concerned.
>
I really don't know. The intent of svn:eol-style was to get coherent
results (diffs, that is) when people use all those editors out there
that can't preserve the eol style.

>Assuming that dropping svn:eol-style is not going to happen, I wonder
>what we can do?  Perhaps we should disable the conversion if the
>text-base is not "correct", and provide a way for the user to force
>the file to be "repaired".  It gets a bit tricky when one already has
>a translated working copy and an 'svn up' brings in a new text-base
>that has faulty eols.
>
I guess the first thing to do is tabulate how things can go wrong, what
we can fix automatically, and which cases we can catch with a warning or
failure. It's not easy, I know

>The problem is that simply defining what eol-conversion should do is
>hard, when one gets beyond the very basic cases anyway.  I don't think
>anyone knows how it should behave, so we certainly don't know how to
>implement it.  My last question about the behaviour didn't get a
>response
>
>http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=31827
>
Ah, yes. Your question here probably covers about 5% of the cases. As I
said, we have to finally tabulate them all.

Any volunteers? This is a nice, self-contained task that only requires
somebody with a clear head and lots of patience; no Subversion knowlege
is required. :-)

>>>Perhaps the solution is that whichever format we choose to use for
>>>diff, a command line flag should be available to cause the other
>>>format to be used.
>>>      
>>>
>>I agree, that flag is useful for other things, too (e.g., svn cat)
>>    
>>
>
>Indeed, in issue 399 I suggested a '--raw' option to disable eol
>conversion.
>  
>
Yes, that would make sense, too -- --eol-style=(native|CR|LF|CRLF|none)
would cover it, right?

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: eol style differences

Posted by Philip Martin <ph...@codematters.co.uk>.
brane@xbc.nu writes:

> > Using working copy style might be better most of the time (I'm not
> > really convinced but I'll just assume it is for now), but it's not
> > clear to me that it is always better.  Two problems come to mind.
> > First, suppose one is comparing two different revisions, using '-rX'
> > or '-rX:Y', then there will be two svn:eol-styles and they may not be
> > the same.  Does each revision of the file get translated according to
> > it's own svn:eol-style, or does one svn:eol-style get used for both?
> 
> I'd propose two things: a) always use the svn:eol-style that's on the version
> your'e looking at;

  $ svn st -v foo.c
         5    5    philip   foo.c
  $ svn diff -r3:4 foo.c

Which is "the version you're looking at",  3, 4 or 5?

Now consider the case without a working copy

  $ svn diff -r3:4 http://server/repo/foo.c

3 or 4?

Now consider merge

  $ svn merge -r3:4 foo.c foo.c

3, 4 or 5?

> and b) remove all keytword expansions when doing diffs. Our internal
> diff lib can do that on-the-fly; for an external diff, we have to
> munge the WC file, too. Sigh.
> 
> > The second problem is more to do with how svn:eol-style works in
> > general.  It is possible to have a repository format file with CRLF
> > line-endings and svn:eol-style set to native.
> 
> That's not how svn:eol-style works; that's how svn:eol-style
> *does't* work. It's a bug, right?

I agree svn:eol-style doesn't work :)  I would describe the current
behaviour as "haphazard".

> Oh. What if you change svn:eol-style on a URL? Wheee...

The client doesn't let you use propset on an URL, not yet anyway.

That is the basic problem though, svn:eol-style is enforced in the
client (by libsvn_wc I think) and so not all clients will do it.  I
think the following is a likely failure mode: a file has svn:eol-style
set to native and a generic WebDAV client on Windows is used to commit
a version of the file with CRLF endings.

> > On Windows a repository
> > format comparison should show every line changed, a working copy
> > comparison should show no change.  Which is correct?
> 
> Actually, if you convert the pristine copy, you'll see no change on Unix, too.
> Which is bad, because then you'll commit the "no change" and be delightfully
> surprised at having changed every line ending in the repo. Oh, duh.

So we just drop svn:eol-style as a mistake?  It's not just Subversion,
the last time I used ClearCase on a Windows/Unix project we stopped
using ClearCase's eol conversion, it didn't do the right thing as far
as we were concerned.

Assuming that dropping svn:eol-style is not going to happen, I wonder
what we can do?  Perhaps we should disable the conversion if the
text-base is not "correct", and provide a way for the user to force
the file to be "repaired".  It gets a bit tricky when one already has
a translated working copy and an 'svn up' brings in a new text-base
that has faulty eols.

The problem is that simply defining what eol-conversion should do is
hard, when one gets beyond the very basic cases anyway.  I don't think
anyone knows how it should behave, so we certainly don't know how to
implement it.  My last question about the behaviour didn't get a
response

http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=31827

> > Perhaps the solution is that whichever format we choose to use for
> > diff, a command line flag should be available to cause the other
> > format to be used.
> 
> I agree, that flag is useful for other things, too (e.g., svn cat)

Indeed, in issue 399 I suggested a '--raw' option to disable eol
conversion.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: eol style differences

Posted by br...@xbc.nu.
Quoting Philip Martin <ph...@codematters.co.uk>:

> "Sander Striker" <st...@apache.org> writes:
> 
> > > Of course, it sounds like now, you can successfully "svn diff",
> > > but it won't tell you where your problem is.
> > 
> > Right, so we need to do the translations the other way around and
> > compare in working copy style.  Anyone care to make that change?
> > Or file an issue?
> 
> Using working copy style might be better most of the time (I'm not
> really convinced but I'll just assume it is for now), but it's not
> clear to me that it is always better.  Two problems come to mind.
> First, suppose one is comparing two different revisions, using '-rX'
> or '-rX:Y', then there will be two svn:eol-styles and they may not be
> the same.  Does each revision of the file get translated according to
> it's own svn:eol-style, or does one svn:eol-style get used for both?

I meand to reply that "Of course you have to use the eol-style that was in force
at the file's revision!"

Then I wondered what happens if you do the same with svn:keywords, and started
saying some quite unprintable things.

I'd propose two things: a) always use the svn:eol-style that's on the version
your'e looking at; and b) remove all keytword expansions when doing diffs. Our
internal diff lib can do that on-the-fly; for an external diff, we have to munge
the WC file, too. Sigh.

> The second problem is more to do with how svn:eol-style works in
> general.  It is possible to have a repository format file with CRLF
> line-endings and svn:eol-style set to native.

That's not how svn:eol-style works; that's how svn:eol-style *does't* work. It's
a bug, right?

Oh. What if you change svn:eol-style on a URL? Wheee...

>  On Windows a repository
> format comparison should show every line changed, a working copy
> comparison should show no change.  Which is correct?

Actually, if you convert the pristine copy, you'll see no change on Unix, too.
Which is bad, because then you'll commit the "no change" and be delightfully
surprised at having changed every line ending in the repo. Oh, duh.

> Perhaps the solution is that whichever format we choose to use for
> diff, a command line flag should be available to cause the other
> format to be used.

I agree, that flag is useful for other things, too (e.g., svn cat)


    Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: eol style differences

Posted by Philip Martin <ph...@codematters.co.uk>.
"Sander Striker" <st...@apache.org> writes:

> > Of course, it sounds like now, you can successfully "svn diff",
> > but it won't tell you where your problem is.
> 
> Right, so we need to do the translations the other way around and
> compare in working copy style.  Anyone care to make that change?
> Or file an issue?

Using working copy style might be better most of the time (I'm not
really convinced but I'll just assume it is for now), but it's not
clear to me that it is always better.  Two problems come to mind.
First, suppose one is comparing two different revisions, using '-rX'
or '-rX:Y', then there will be two svn:eol-styles and they may not be
the same.  Does each revision of the file get translated according to
it's own svn:eol-style, or does one svn:eol-style get used for both?

The second problem is more to do with how svn:eol-style works in
general.  It is possible to have a repository format file with CRLF
line-endings and svn:eol-style set to native.  On Windows a repository
format comparison should show every line changed, a working copy
comparison should show no change.  Which is correct?

Perhaps the solution is that whichever format we choose to use for
diff, a command line flag should be available to cause the other
format to be used.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: eol style differences

Posted by Sander Striker <st...@apache.org>.
> From: Greg Hudson [mailto:ghudson@MIT.EDU]
> Sent: Tuesday, March 11, 2003 9:23 PM

> (I wish there were a mail archive of this list which kept message IDs,
> so I could generate proper responses after accidentally deleting the
> mail I want to respond to.)
> 
> Branko wrote:
> > Whichever code it is, it's doing the wrong thing. The text base
> > should be converted to WC style, not the other way around, otherwise
> > you won't notice newline-only changes.
> 
> > Oh, duh -- that would make keyword expansions cause problems for us
> > again. What a bore.
> 
> This just means we have to parameterize the keyword expansion code so
> that we can say "expand this text base with the same substitutions as
> we used on the working copy."

We can simply translate the working copy to collapsed keywords.  That
is already part of the API.
 
>> Hmm, maybe the conversion from WC style to text-base style should
>> notice if the WC file line endings aren't consistent with what's
>> declared in svn:eol-style?
> 
> I think it used to, but we turned that check off for everything but
> "svn commit" after someone complained that it was difficult to recover
> from having inconsistent newlines.  You couldn't even "svn revert" at
> that time, which was really bad, but you also couldn't "svn diff" to
> find out where your problem was.  Of course, it sounds like now, you
> can successfully "svn diff", but it won't tell you where your problem
> is.

Right, so we need to do the translations the other way around and
compare in working copy style.  Anyone care to make that change?
Or file an issue?

Sander


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org