On Tue, Feb 1, 2011 at 9:39 PM, David Chapman <dcchapman_at_acm.org> wrote:
> Running Subversion 1.6.15 under Windows 7, if I redirect the output of "svn
> diff" to a file and then try to edit that file using Notepad, the line
> breaks are garbled. In particular they have only the '\n' character, not
> the '\r' character.
>
> For example, if "svn_usage_notes.txt" is in my repository, and I do the
> following in a sandbox:
>
> echo foo >> svn_usage_notes.txt
> echo bar >> svn_usage_notes.txt
> echo zot >> svn_usage_notes.txt
> svn diff svn_usage_notes.txt > wowow.txt
> od -c wowow.txt
>
> I get:
>
> 0000000 I n d e x : s v n _ u s a g e
> 0000020 _ n o t e s . t x t \r \n = = = =
> 0000040 = = = = = = = = = = = = = = = =
> *
> 0000120 = = = = = = = = = = = = = = = \r
> 0000140 \n - - - s v n _ u s a g e _ n
> 0000160 o t e s . t x t \t ( r e v i s i
> 0000200 o n 1 1 1 6 ) \r \n + + + s v
> 0000220 n _ u s a g e _ n o t e s . t x
> 0000240 t \t ( w o r k i n g c o p y )
> 0000260 \r \n @ @ - 6 1 2 2 , 3 + 6 1
> 0000300 2 2 , 6 @ @ \r \n \n M a r k
> 0000320 P h i p p a r d \n h t t p :
> 0000340 / / m a r k p h i p . b l o g s
> 0000360 p o t . c o m / \n + f o o \n +
> 0000400 b a r \n + z o t \n
> 0000413
>
> Note how the first part of the file has "\r\n" while the last part (showing
> the extra lines) has only '\n'. The file itself has "\r\n" for every line,
> and I have the following line in
> C:\Users\David\AppData\Roaming\Subversion\config:
>
> *.txt = svn:eol-style=native
Ok, that may be your client side config, but maybe it's not working
correctly or not being picked up for whatever reason. Can you verify
directly whether the property is set on the file?
svn propget svn:eol-style svn_usage_notes.txt
> The absence of newlines makes it impossible to view the differences file in
> Notepad. Years ago before I knew about "unzip -a", I wrote a program to add
> carriage returns to text files being copied from Linux to Windows and so I
> can use that, but it would be nice to have system-appropriate line endings
> in the output of "svn diff" without this extra step.
>
> Is anyone else seeing this? Is there a configuration parameter I can set to
> fix it, or is it a bug that should be bumped to the dev list?
Certainly no need to escalate to the dev list (unless we're going to
discuss design/implementation considerations or something). We can
discuss it on this list, and if we find out it's a genuine issue, you
can submit it to the issue tracker.
> (For the record, I have "UnxUtils.zip" loaded, so I have a number of
> Unix/Linux utilities such as "od" available under Windows, and only the
> Windows Subversion executable ever writes into a Windows sandbox.)
Ok, this may be a very important detail. Can you first try to
reproduce this issue without the UnxUtils loaded?
Which client are you using actually (which distribution)? You aren't
using one from cygwin are you? There are known problems with the svn
client that comes with cygwin (don't know the details, but I think it
can be confused about its native eol-style, because it thinks it's
running on unix etc.).
Also, is this something new you're seeing only from 1.6.15? Can you
try reproducing with an older version, and try to find out when the
problem first appeared?
Cheers,
--
Johan
Received on 2011-02-01 22:30:29 CET