You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Tobias Ringstrom <to...@ringstrom.mine.nu> on 2004/04/04 08:25:53 UTC

svn diff and native eol style

svn diff does not respect the EOL style, at least not when it is set to 
native.  Before the diff is calculated or an external diff is called, 
the two files to be diffed are converted to NL EOL style.  This means 
that on e.g. Win32, the diff chunks contain NL EOLs for files with 
native EOL style, which of course breaks patch among other things.

I think the way to fix the problem is to convert the two files to the 
correct EOL style before diffing.  I'm planning to write an issue about 
this, but I wanted to see if anyone had any comments first.

/Tobias


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

Re: [OT] svn diff and native eol style

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

>Branko Cibej wrote:
>  
>
>>And silently curse Windows that got its
>>convention from DOS that got it from CP/M that got it -- probably --
>>from teletype transmission standards... and some research would probably
>>show it all stems from some convention used by Summerian scribes, or
>>something :-\
>>    
>>
>
>According to http://weblogs.asp.net/oldnewthing/archive/2004/03/18/91899.aspx, 
>'the real question is not "Why do CP/M, MS-DOS, and Win32 use CR+LF as the line terminator?" but rather "Why did other people choose to differ from these standards documents and use some other line terminator?"'
>  
>
Yes, you're right! After all, VMS uses CRLF too (actually, LF as the
start-of-line mark, and CR as the end-of-line mar, but it comes to the
same thing -- almost), and anyone who ignores VMS -- even to make
everyone's life simpler -- deserves any problems they have because of
it. :-)

-- 
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: [OT] svn diff and native eol style

Posted by Arild Fines <ar...@broadpark.no>.
Branko Cibej wrote:
> And silently curse Windows that got its
> convention from DOS that got it from CP/M that got it -- probably --
> from teletype transmission standards... and some research would probably
> show it all stems from some convention used by Summerian scribes, or
> something :-\

According to http://weblogs.asp.net/oldnewthing/archive/2004/03/18/91899.aspx, 
'the real question is not "Why do CP/M, MS-DOS, and Win32 use CR+LF as the line terminator?" but rather "Why did other people choose to differ from these standards documents and use some other line terminator?"'

-- 
Arild

AnkhSVN: http://ankhsvn.tigris.org
Blog: http://ankhsvn.com/blog
IRC: irc://irc.freenode.net/ankhsvn

"We've got to find out what people want from fire, how they relate to it,
what sort of image it has for them.' The crowd were tense. They were
expecting something wonderful from Ford.`Stick it up your nose,' he
said.`Which is precisely the sort of thing we need to know,' insisted the
girl, `Do people want fire that can be fitted nasally?'"    


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


Re: svn diff and native eol style

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

> Branko Čibej wrote:
>
>> I don't think we should convert at all. If the files differ only in the
>> EOL style, I think diff should show that (unless given an ignore-eol or
>> ighore-whitespace option).
>
>
> When the eol style is native, the text base has LF endings, and the WC
> has CRNL line endings on Win32, so some conversion must be made.
> Remotely accessed files also use LF only when svn:eol is native.

Some conversions must be made anyway, to account for keywords and such.
This means that the text base has to be converted to native format.

For example, currently if your editor inserts different EOL chars than
those already used by the file, "svn diff" won't tell you about that,
but "svn ci" _will_ store the wrong delimiters (of course unless
svn:eol-style is native).

It's a can of worms, and situations like this make me lean towards
agreeing with ghudson about the evilness of newline conversion. :-)
Sadly, we have to live with it. And silently curse Windows that got its
convention from DOS that got it from CP/M that got it -- probably --
from teletype transmission standards... and some research would probably
show it all stems from some convention used by Summerian scribes, or
something :-\


-- 
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: svn diff and native eol style

Posted by Tobias Ringstrom <to...@ringstrom.mine.nu>.
Branko Čibej wrote:
> I don't think we should convert at all. If the files differ only in the
> EOL style, I think diff should show that (unless given an ignore-eol or
> ighore-whitespace option).

When the eol style is native, the text base has LF endings, and the WC 
has CRNL line endings on Win32, so some conversion must be made. 
Remotely accessed files also use LF only when svn:eol is native.

/Tobias

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

Re: svn diff and native eol style

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

> svn diff does not respect the EOL style, at least not when it is set
> to native.  Before the diff is calculated or an external diff is
> called, the two files to be diffed are converted to NL EOL style. 
> This means that on e.g. Win32, the diff chunks contain NL EOLs for
> files with native EOL style, which of course breaks patch among other
> things.
>
> I think the way to fix the problem is to convert the two files to the
> correct EOL style before diffing.  I'm planning to write an issue
> about this, but I wanted to see if anyone had any comments first.

I don't think we should convert at all. If the files differ only in the
EOL style, I think diff should show that (unless given an ignore-eol or
ighore-whitespace option).


-- 
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