You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Adam Miazga <ad...@gmail.com> on 2011/10/17 14:21:02 UTC

Problem with diff

Hi.

I have one "magick" file (in attachment).
I commit this file to repository. I add line
"/**/"
into end of file. And again I commit the file to repository.

When i invoke "svn diff -r n:m kadr.polon.p" i recive

in Subversion 1.6
Index: kadr.polon.p
===================================================================
--- kadr.polon.p        (revision 7)
+++ kadr.polon.p        (revision 8)
@@ -463,3 +463,5 @@
   IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
END.
{ws_i/log.i}
+
+/**/

in Subversion 1.7
Index: kadr.polon.p
===================================================================
--- kadr.polon.p        (revision 7)
+++ kadr.polon.p        (revision 8)
@@ -460,6 +460,8 @@
    EMPTY TEMP-TABLE tt_tytnauk.
    EMPTY TEMP-TABLE tt_stnauk.
    pOstatni = vIlosc.
+   IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
+END.
    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
 END.
 {ws_i/log.i}

When i change last line from "/**/" to "some new line" svn diff display this

1.6
Index: kadr.polon.p
===================================================================
--- kadr.polon.p        (revision 8)
+++ kadr.polon.p        (revision 9)
@@ -464,4 +464,4 @@
END.
{ws_i/log.i}

-/**/
\ No newline at end of file
+some new line
\ No newline at end of file

1.7
Index: kadr.polon.p
===================================================================
--- kadr.polon.p        (revision 8)
+++ kadr.polon.p        (revision 9)
@@ -461,7 +461,7 @@
    EMPTY TEMP-TABLE tt_stnauk.
    pOstatni = vIlosc.
    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
-END.
+END.
 {ws_i/log.i}

 /**/
\ No newline at end of file

Best regards
Adam Miazga

Re: Problem with diff

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Andreas Krey wrote on Tue, Oct 18, 2011 at 06:04:12 +0200:
> #!/bin/sh
  alias svn=$svn svnadmin=$svnadmin
> rm -rf svntmp
> mkdir svntmp
> cd svntmp
> svnadmin create repo
> svn checkout file://`pwd`/repo wc
> cd wc
> cp ../../kadr.polon.p .
> svn add kadr.polon.p 
> svn commit -m 1
> cat >>kadr.polon.p <<EOF
> 
> /**/
> EOF
> svn diff
> exit

I see the correct diff output with an 1.7.0-rc2 build, from tarball, on
a 32-bit sparc sunos box.

Re: Problem with diff

Posted by Andreas Krey <a....@gmx.de>.
On Tue, 18 Oct 2011 10:32:36 +0000, Daniel Shahaf wrote:
....
> 
> Thanks for the self-contained recipe!

Is the only sane way to do such stuff.

> Using it I cannot reproduce the bug using either 1.6.12, 1.7.0, or
> trunk.  I'm on a 32-bit Linux system, using apr/apr-util as shipped with
> httpd 2.2.19/2.3.15; I'll try later in other environments.

Is not supposed to be in 1.6.2. I'm on vanilla macos 10.5.8, self-built,
with apr from deps. Can't deduce 32/64 bits right now (need to leave train).

Andreas

Re: Problem with diff

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Andreas Krey wrote on Tue, Oct 18, 2011 at 06:04:12 +0200:
> On Mon, 17 Oct 2011 14:21:02 +0000, Adam Miazga wrote:
> > Hi.
> > 
> > I have one "magick" file (in attachment).
> > I commit this file to repository. I add line
> > "/**/"
> > into end of file. And again I commit the file to repository.
> > 
> > When i invoke "svn diff -r n:m kadr.polon.p" i recive
> > 
> > in Subversion 1.6
> > Index: kadr.polon.p
> > ===================================================================
> > --- kadr.polon.p        (revision 7)
> > +++ kadr.polon.p        (revision 8)
> > @@ -463,3 +463,5 @@
> >    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
> > END.
> > {ws_i/log.i}
> > +
> > +/**/
> 
> Same here (with -rc2, actually). Run:
> 
> =========
> #!/bin/sh
> rm -rf svntmp
> mkdir svntmp
> cd svntmp
> svnadmin create repo
> svn checkout file://`pwd`/repo wc
> cd wc
> cp ../../kadr.polon.p .
> svn add kadr.polon.p 
> svn commit -m 1
> cat >>kadr.polon.p <<EOF
> 
> /**/
> EOF
> svn diff
> exit
> =========
> 
> in a directory with the original file and get
> 

Thanks for the self-contained recipe!

Using it I cannot reproduce the bug using either 1.6.12, 1.7.0, or
trunk.  I'm on a 32-bit Linux system, using apr/apr-util as shipped with
httpd 2.2.19/2.3.15; I'll try later in other environments.

> ===================================================================
> --- kadr.polon.p	(revision 1)
> +++ kadr.polon.p	(working copy)
> @@ -461,6 +461,8 @@
>     EMPTY TEMP-TABLE tt_tytnauk.
>     EMPTY TEMP-TABLE tt_stnauk.
>     pOstatni = vIlosc.
> +   IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
> +END.
>     IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
>  END.
>  {ws_i/log.i}
> 
> as the diff.
> 
> But happens only with this specific file; can't reproduce with
> other content.
> 
> Andreas
> 
> -- 
> "Totally trivial. Famous last words."
> From: Linus Torvalds <torvalds@*.org>
> Date: Fri, 22 Jan 2010 07:29:21 -0800

Re: Problem with diff

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Andreas Krey wrote on Wed, Oct 19, 2011 at 12:00:27 +0200:
> On Wed, 19 Oct 2011 11:37:25 +0000, Daniel Shahaf wrote:
> ...
> > Adam, Andreas: when you say what passes/fails for you, please also
> > mentino the environment.  I've so far tested on 32bit Linux and I plan
> > to test in a couple more environments once I rebuild trunk on them.
> 
> Do you build your test subject from the tar file or directly from svn?
> 

1.6.12 from Debian package or 1.6.x self-compiled (can't remember);
1.7.0 from upstream tarball; trunk@HEAD from svn.

> The funny thing is that the resulting diffs do not only differ from
> the expected result but are also different between machines.
> 
> That's why I wanted to build for Solaris: To see what happens there.
> 
> ...
> > > > My apple produces (without any svn:prop):
> 
> Plain 10.5.8 with compiler from xcode, compiled from source. Probably 32bit.
> 

gcc (Debian 4.4.5-8) 4.4.5

> > > > +   450    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
> > > > +   451 END.
> 
> > > > and the linux box makes that
> 
> SuSE 10.2, Kernel (irrelevant) 2.6.18.8-0.3, apparently 64bit executable.
> 

Debian

> > > > +   452 {ws_i/log.i}
> > > > +
> 
> Andreas
> 
> -- 
> "Totally trivial. Famous last words."
> From: Linus Torvalds <torvalds@*.org>
> Date: Fri, 22 Jan 2010 07:29:21 -0800

Re: Problem with diff

Posted by Adam Miazga <ad...@gmail.com>.
I've tested in Windows 7
Command line svn from VisualSVN version 2.5.0
GUI via TortoiseSVN 1.7 RC1,TortoiseSVN 1.7, TortoiseSVN 1.7
Nightbuild 22093 and TortoiseSVN 1.7 Nightbuild 22114
And SLES 10.2 x86 32bit
Subversion 1.7 builded from tar.

in all cases diff looks that same.

Adam Miazga

2011/10/19 Andreas Krey <a....@gmx.de>:
> On Wed, 19 Oct 2011 11:37:25 +0000, Daniel Shahaf wrote:
> ...
>> Adam, Andreas: when you say what passes/fails for you, please also
>> mentino the environment.  I've so far tested on 32bit Linux and I plan
>> to test in a couple more environments once I rebuild trunk on them.
>
> Do you build your test subject from the tar file or directly from svn?
>
> The funny thing is that the resulting diffs do not only differ from
> the expected result but are also different between machines.
>
> That's why I wanted to build for Solaris: To see what happens there.
>
> ...
>> > > My apple produces (without any svn:prop):
>
> Plain 10.5.8 with compiler from xcode, compiled from source. Probably 32bit.
>
>> > > +   450    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
>> > > +   451 END.
>
>> > > and the linux box makes that
>
> SuSE 10.2, Kernel (irrelevant) 2.6.18.8-0.3, apparently 64bit executable.
>
>> > > +   452 {ws_i/log.i}
>> > > +
>
> Andreas
>
> --
> "Totally trivial. Famous last words."
> From: Linus Torvalds <torvalds@*.org>
> Date: Fri, 22 Jan 2010 07:29:21 -0800
>

Re: Problem with diff

Posted by Andreas Krey <a....@gmx.de>.
On Wed, 19 Oct 2011 11:37:25 +0000, Daniel Shahaf wrote:
...
> Adam, Andreas: when you say what passes/fails for you, please also
> mentino the environment.  I've so far tested on 32bit Linux and I plan
> to test in a couple more environments once I rebuild trunk on them.

Do you build your test subject from the tar file or directly from svn?

The funny thing is that the resulting diffs do not only differ from
the expected result but are also different between machines.

That's why I wanted to build for Solaris: To see what happens there.

...
> > > My apple produces (without any svn:prop):

Plain 10.5.8 with compiler from xcode, compiled from source. Probably 32bit.

> > > +   450    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
> > > +   451 END.

> > > and the linux box makes that

SuSE 10.2, Kernel (irrelevant) 2.6.18.8-0.3, apparently 64bit executable.

> > > +   452 {ws_i/log.i}
> > > +

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

Re: Problem with diff

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Adam Miazga wrote on Wed, Oct 19, 2011 at 10:17:56 +0200:
> Hi
> 
> Daniel try this way
> 
> 1. download file from first message
> 2. commit this file without modification
> 3. add new line via
> echo "test" >>kadr.polon.p
> 4. commit changed file
> 5.generate diff
> 

Thanks for the recipe, however, I already tried those steps, including
generating a diff both before and after the commit. (and couldn't
reproduce)

Adam, Andreas: when you say what passes/fails for you, please also
mentino the environment.  I've so far tested on 32bit Linux and I plan
to test in a couple more environments once I rebuild trunk on them.

> I tried to repeat this situation with another file. All my attempts have failed.
> This file have corrupted line endings and open and save this file in
> editor which modfied line endings repaired it.
> 
> Successful attempts
> Adam Miazga
> 
> 2011/10/18 Andreas Krey <a....@gmx.de>:
> > On Tue, 18 Oct 2011 17:54:41 +0000, Daniel Shahaf wrote:
> > ...
> >> svnmucc, and then append two lines and diff before/after committing,
> >> but still couldn't reproduce your issue.
> >
> > I can't reproduce it on the linux box, either. At least not exactly.
> > This is going to be fun.
> >
> > My apple produces (without any svn:prop):
> >
> > ===================================================================
> > --- kadr.polon.p        (revision 1)
> > +++ kadr.polon.p        (revision 2)
> > @@ -461,6 +461,8 @@
> >    447    EMPTY TEMP-TABLE tt_tytnauk.
> >    448    EMPTY TEMP-TABLE tt_stnauk.
> >    449    pOstatni = vIlosc.
> > +   450    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
> > +   451 END.
> >    450    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
> >    451 END.
> >    452 {ws_i/log.i}
> >
> > and the linux box makes that
> >
> > ===================================================================
> > --- kadr.polon.p        (revision 1)
> > +++ kadr.polon.p        (revision 2)
> > @@ -463,4 +463,6 @@
> >    449    pOstatni = vIlosc.
> >    450    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
> >    451 END.
> > +   452 {ws_i/log.i}
> > +
> >    452 {ws_i/log.i}
> >
> > Uninitialized variable that then points to the wrong lines?
> >
> > Andreas
> >
> > --
> > "Totally trivial. Famous last words."
> > From: Linus Torvalds <torvalds@*.org>
> > Date: Fri, 22 Jan 2010 07:29:21 -0800
> >

Re: Problem with diff

Posted by Adam Miazga <ad...@gmail.com>.
Hi

Daniel try this way

1. download file from first message
2. commit this file without modification
3. add new line via
echo "test" >>kadr.polon.p
4. commit changed file
5.generate diff

I tried to repeat this situation with another file. All my attempts have failed.
This file have corrupted line endings and open and save this file in
editor which modfied line endings repaired it.

Successful attempts
Adam Miazga

2011/10/18 Andreas Krey <a....@gmx.de>:
> On Tue, 18 Oct 2011 17:54:41 +0000, Daniel Shahaf wrote:
> ...
>> svnmucc, and then append two lines and diff before/after committing,
>> but still couldn't reproduce your issue.
>
> I can't reproduce it on the linux box, either. At least not exactly.
> This is going to be fun.
>
> My apple produces (without any svn:prop):
>
> ===================================================================
> --- kadr.polon.p        (revision 1)
> +++ kadr.polon.p        (revision 2)
> @@ -461,6 +461,8 @@
>    447    EMPTY TEMP-TABLE tt_tytnauk.
>    448    EMPTY TEMP-TABLE tt_stnauk.
>    449    pOstatni = vIlosc.
> +   450    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
> +   451 END.
>    450    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
>    451 END.
>    452 {ws_i/log.i}
>
> and the linux box makes that
>
> ===================================================================
> --- kadr.polon.p        (revision 1)
> +++ kadr.polon.p        (revision 2)
> @@ -463,4 +463,6 @@
>    449    pOstatni = vIlosc.
>    450    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
>    451 END.
> +   452 {ws_i/log.i}
> +
>    452 {ws_i/log.i}
>
> Uninitialized variable that then points to the wrong lines?
>
> Andreas
>
> --
> "Totally trivial. Famous last words."
> From: Linus Torvalds <torvalds@*.org>
> Date: Fri, 22 Jan 2010 07:29:21 -0800
>

Re: Problem with diff

Posted by Andreas Krey <a....@gmx.de>.
On Tue, 18 Oct 2011 17:54:41 +0000, Daniel Shahaf wrote:
...
> svnmucc, and then append two lines and diff before/after committing,
> but still couldn't reproduce your issue.

I can't reproduce it on the linux box, either. At least not exactly.
This is going to be fun.

My apple produces (without any svn:prop):

===================================================================
--- kadr.polon.p	(revision 1)
+++ kadr.polon.p	(revision 2)
@@ -461,6 +461,8 @@
    447	   EMPTY TEMP-TABLE tt_tytnauk.
    448	   EMPTY TEMP-TABLE tt_stnauk.
    449	   pOstatni = vIlosc.
+   450	   IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
+   451	END.
    450	   IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
    451	END.
    452	{ws_i/log.i}

and the linux box makes that

===================================================================
--- kadr.polon.p        (revision 1)
+++ kadr.polon.p        (revision 2)
@@ -463,4 +463,6 @@
    449    pOstatni = vIlosc.
    450    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
    451 END.
+   452 {ws_i/log.i}
+
    452 {ws_i/log.i}

Uninitialized variable that then points to the wrong lines?

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

Re: Problem with diff

Posted by Andreas Krey <a....@gmx.de>.
On Tue, 18 Oct 2011 17:54:41 +0000, Daniel Shahaf wrote:
> I tried adding your file with svn:eol-style=native and forcing the
> backend to have non-normalized EOLs (despite the property) by using
> svnmucc, and then append two lines and diff before/after committing,
> but still couldn't reproduce your issue.

I did that (obviously) without any svn:properties.

Is there any chance that this may be caused when another svn exist
further behind in PATH? (My 1.7 is in '$HOME/svn17'.) That is, that
svn picks up additional files from elsewhere?

Will try soon to build on a regular, if old, linux box.

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

Re: Problem with diff

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
I tried adding your file with svn:eol-style=native and forcing the
backend to have non-normalized EOLs (despite the property) by using
svnmucc, and then append two lines and diff before/after committing,
but still couldn't reproduce your issue.

Adam Miazga wrote on Tue, Oct 18, 2011 at 14:33:44 +0200:
> Hi.
> 
> I resolv my problem.
> When I set "*.p = svn:eol-style=native" in config file then svn ses
> 
> svn: E200009: File '..\kadr.polon.p' has inconsistent newlines
> svn: E135000: Inconsistent line ending style
> 
> I'm convert line ending in my file and work fine.
> 
> in subversion 1.6 the problem does not exist.
> 
> I don't known if is a bug or feature ;-)
> 
> Best regards
> Adam Miazga
> 
> 2011/10/18 Daniel Shahaf <d....@daniel.shahaf.name>:
> > Andreas Krey wrote on Tue, Oct 18, 2011 at 10:37:36 +0200:
> >> On Tue, 18 Oct 2011 10:22:33 +0000, Daniel Shahaf wrote:
> >> ...
> >> > > Replacing each char by another one (individually, not caesar).
> >> > > But stays, though no duplicate lines:
> >> > >
> >> >
> >> > Huh?  This transformation doesn't deduplicate, there were duplicate lines
> >> > to begin with, so the result should also contain duplicates.
> >>
> >> Er, it does. Each character is replaced by a random one, and the
> >> next same character by another random one, so 'aaaa' becomes 'ehaf'
> >> (or 'qrhs' or whatever, of course).
> >>
> >
> > Ah, I thought you passed the file through tr(1).
> >
> >> ..
> >> > > I really like to see *that* patch.
> >> > >
> >> >
> >> > Which one?  The one introducing the bug or fixing it?
> >> >
> >>
> >> The fix, where it is easier to see what went wrong (hopefully in the
> >> commit message). Gotta be interesting. Didn't even think to bisect for
> >> the regression up to now.
> >>
> >> Is the diff engine separate from the delta computation?
> >>
> >
> > Yes.  libsvn_diff is about line-based diffs/merges; libsvn_delta is
> > about binary deltas and their wire representation as svndiff streams.
> > (Yes, the naming is... confusing.)
> >
> >> Andreas
> >>
> >> --
> >> "Totally trivial. Famous last words."
> >> From: Linus Torvalds <torvalds@*.org>
> >> Date: Fri, 22 Jan 2010 07:29:21 -0800
> >

Re: Problem with diff

Posted by Adam Miazga <ad...@gmail.com>.
Hi.

I resolv my problem.
When I set "*.p = svn:eol-style=native" in config file then svn ses

svn: E200009: File '..\kadr.polon.p' has inconsistent newlines
svn: E135000: Inconsistent line ending style

I'm convert line ending in my file and work fine.

in subversion 1.6 the problem does not exist.

I don't known if is a bug or feature ;-)

Best regards
Adam Miazga

2011/10/18 Daniel Shahaf <d....@daniel.shahaf.name>:
> Andreas Krey wrote on Tue, Oct 18, 2011 at 10:37:36 +0200:
>> On Tue, 18 Oct 2011 10:22:33 +0000, Daniel Shahaf wrote:
>> ...
>> > > Replacing each char by another one (individually, not caesar).
>> > > But stays, though no duplicate lines:
>> > >
>> >
>> > Huh?  This transformation doesn't deduplicate, there were duplicate lines
>> > to begin with, so the result should also contain duplicates.
>>
>> Er, it does. Each character is replaced by a random one, and the
>> next same character by another random one, so 'aaaa' becomes 'ehaf'
>> (or 'qrhs' or whatever, of course).
>>
>
> Ah, I thought you passed the file through tr(1).
>
>> ..
>> > > I really like to see *that* patch.
>> > >
>> >
>> > Which one?  The one introducing the bug or fixing it?
>> >
>>
>> The fix, where it is easier to see what went wrong (hopefully in the
>> commit message). Gotta be interesting. Didn't even think to bisect for
>> the regression up to now.
>>
>> Is the diff engine separate from the delta computation?
>>
>
> Yes.  libsvn_diff is about line-based diffs/merges; libsvn_delta is
> about binary deltas and their wire representation as svndiff streams.
> (Yes, the naming is... confusing.)
>
>> Andreas
>>
>> --
>> "Totally trivial. Famous last words."
>> From: Linus Torvalds <torvalds@*.org>
>> Date: Fri, 22 Jan 2010 07:29:21 -0800
>

Re: Problem with diff

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Andreas Krey wrote on Tue, Oct 18, 2011 at 10:37:36 +0200:
> On Tue, 18 Oct 2011 10:22:33 +0000, Daniel Shahaf wrote:
> ...
> > > Replacing each char by another one (individually, not caesar).
> > > But stays, though no duplicate lines:
> > > 
> > 
> > Huh?  This transformation doesn't deduplicate, there were duplicate lines
> > to begin with, so the result should also contain duplicates.
> 
> Er, it does. Each character is replaced by a random one, and the
> next same character by another random one, so 'aaaa' becomes 'ehaf'
> (or 'qrhs' or whatever, of course).
> 

Ah, I thought you passed the file through tr(1).

> ..
> > > I really like to see *that* patch.
> > > 
> > 
> > Which one?  The one introducing the bug or fixing it?
> > 
> 
> The fix, where it is easier to see what went wrong (hopefully in the
> commit message). Gotta be interesting. Didn't even think to bisect for
> the regression up to now.
> 
> Is the diff engine separate from the delta computation?
> 

Yes.  libsvn_diff is about line-based diffs/merges; libsvn_delta is
about binary deltas and their wire representation as svndiff streams.
(Yes, the naming is... confusing.)

> Andreas
> 
> -- 
> "Totally trivial. Famous last words."
> From: Linus Torvalds <torvalds@*.org>
> Date: Fri, 22 Jan 2010 07:29:21 -0800

Re: Problem with diff

Posted by Andreas Krey <a....@gmx.de>.
On Tue, 18 Oct 2011 10:22:33 +0000, Daniel Shahaf wrote:
...
> 371 != 450+3, so there are some duplicate lines.

Yes. I forgot to say "it's source code, so of course there are dups". :-)

...
> > Replacing each char by another one (individually, not caesar).
> > But stays, though no duplicate lines:
> > 
> 
> Huh?  This transformation doesn't deduplicate, there were duplicate lines
> to begin with, so the result should also contain duplicates.

Er, it does. Each character is replaced by a random one, and the
next same character by another random one, so 'aaaa' becomes 'ehaf'
(or 'qrhs' or whatever, of course).

..
> > I really like to see *that* patch.
> > 
> 
> Which one?  The one introducing the bug or fixing it?
> 

The fix, where it is easier to see what went wrong (hopefully in the
commit message). Gotta be interesting. Didn't even think to bisect for
the regression up to now.

Is the diff engine separate from the delta computation?

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

Re: Problem with diff

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Andreas Krey wrote on Tue, Oct 18, 2011 at 10:05:39 +0200:
> On Tue, 18 Oct 2011 08:55:44 +0000, Daniel Shahaf wrote:
> > > 
> > > as the diff.
> > > 
> > > But happens only with this specific file; can't reproduce with
> > > other content.
> > > 
> > 
> > Does the file (either before or after the append) contain two identical
> > lines?  If so, could you try replacing each line in the file by a unique
> > string?  You can do that with
> > 
> > % perl -lne 'print $h{$_} ||= $unique++' \
> >   <kadr.polon.p >kadr.polon.p.anonymized
> 
> 
> Nice trick, but unnecessary. The original file was an attachment on the
> mail I replied to.
> 

Oops, missed it.

> But that does not trigger the bug:
> 
> ===================================================================
> --- kadr.polon.p	(revision 1)
> +++ kadr.polon.p	(revision 2)
> @@ -450,3 +450,5 @@
>  369
>  370
>  371

371 != 450+3, so there are some duplicate lines.

> +
> +/**/
> 
> Replacing each char by another one (individually, not caesar).
> But stays, though no duplicate lines:
> 

Huh?  This transformation doesn't deduplicate, there were duplicate lines
to begin with, so the result should also contain duplicates.

> Using cat -n on the file: Bug stays, even more surprisingly:
> 
> ===================================================================
> --- kadr.polon.p	(revision 1)
> +++ kadr.polon.p	(revision 2)
> @@ -461,6 +461,8 @@
>     447	   EMPTY TEMP-TABLE tt_tytnauk.
>     448	   EMPTY TEMP-TABLE tt_stnauk.
>     449	   pOstatni = vIlosc.
> +   450	   IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
> +   451	END.
>     450	   IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
>     451	END.
>     452	{ws_i/log.i}
> 

Interesting.

> So, it is not the line uniqeness, but rather it looks like having to do
> with the line length structure.
> 
> I really like to see *that* patch.
> 

Which one?  The one introducing the bug or fixing it?

> Andreas
> 
> -- 
> "Totally trivial. Famous last words."
> From: Linus Torvalds <torvalds@*.org>
> Date: Fri, 22 Jan 2010 07:29:21 -0800

Re: Problem with diff

Posted by Andreas Krey <a....@gmx.de>.
On Tue, 18 Oct 2011 08:55:44 +0000, Daniel Shahaf wrote:
> > 
> > as the diff.
> > 
> > But happens only with this specific file; can't reproduce with
> > other content.
> > 
> 
> Does the file (either before or after the append) contain two identical
> lines?  If so, could you try replacing each line in the file by a unique
> string?  You can do that with
> 
> % perl -lne 'print $h{$_} ||= $unique++' \
>   <kadr.polon.p >kadr.polon.p.anonymized


Nice trick, but unnecessary. The original file was an attachment on the
mail I replied to.

But that does not trigger the bug:

===================================================================
--- kadr.polon.p	(revision 1)
+++ kadr.polon.p	(revision 2)
@@ -450,3 +450,5 @@
 369
 370
 371
+
+/**/

Passing the file through rot13: Bug stays:

===================================================================
--- kadr.polon.p	(revision 1)
+++ kadr.polon.p	(revision 2)
@@ -461,6 +461,8 @@
    RZCGL GRZC-GNOYR gg_glganhx.
    RZCGL GRZC-GNOYR gg_fganhx.
    cBfgngav = iVybfp.
+   VS iVybfp = (cFgneg + cVybfp - 1) gura yrnir Tybony_ybbc.
+RAQ.
    VS iVybfp = (cFgneg + cVybfp - 1) gura yrnir Tybony_ybbc.
 RAQ.
 {jf_v/ybt.v}

Replacing each char by another one (individually, not caesar).
But stays, though no duplicate lines:

===================================================================
--- kadr.polon.p	(revision 1)
+++ kadr.polon.p	(revision 2)
@@ -461,6 +461,8 @@
    TVJBN TKFW-NXNXO kr_sqeujxy.
    KUNPS UABP-ASKTF rj_lgdujj.
    aOxxrupn = tMjwdl.
+   IA dOjubh = (hZnfpq + wPykty - 1) flse cbfgj Onaorw_svvq.
+AKM.
    IA dOjubh = (hZnfpq + wPykty - 1) flse cbfgj Onaorw_svvq.
 AKM.
 {iv_c/dpv.r}

Using cat -n on the file: Bug stays, even more surprisingly:

===================================================================
--- kadr.polon.p	(revision 1)
+++ kadr.polon.p	(revision 2)
@@ -461,6 +461,8 @@
    447	   EMPTY TEMP-TABLE tt_tytnauk.
    448	   EMPTY TEMP-TABLE tt_stnauk.
    449	   pOstatni = vIlosc.
+   450	   IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
+   451	END.
    450	   IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
    451	END.
    452	{ws_i/log.i}

So, it is not the line uniqeness, but rather it looks like having to do
with the line length structure.

I really like to see *that* patch.

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

Re: Problem with diff

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Daniel Shahaf wrote on Tue, Oct 18, 2011 at 08:55:44 +0200:
> % perl -lne 'print $h{$_} ||= $unique++' \

Small bug: the last expression should be '++$unique'.  (I actually
caught that before posting, but copy-pasted the wrong version.)

Re: Problem with diff

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Andreas Krey wrote on Tue, Oct 18, 2011 at 06:04:12 +0200:
> On Mon, 17 Oct 2011 14:21:02 +0000, Adam Miazga wrote:
> > Hi.
> > 
> > I have one "magick" file (in attachment).
> > I commit this file to repository. I add line
> > "/**/"
> > into end of file. And again I commit the file to repository.
> > 
> > When i invoke "svn diff -r n:m kadr.polon.p" i recive
> > 
> > in Subversion 1.6
> > Index: kadr.polon.p
> > ===================================================================
> > --- kadr.polon.p        (revision 7)
> > +++ kadr.polon.p        (revision 8)
> > @@ -463,3 +463,5 @@
> >    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
> > END.
> > {ws_i/log.i}
> > +
> > +/**/
> 
> Same here (with -rc2, actually). Run:
> 
> =========
> #!/bin/sh
> rm -rf svntmp
> mkdir svntmp
> cd svntmp
> svnadmin create repo
> svn checkout file://`pwd`/repo wc
> cd wc
> cp ../../kadr.polon.p .
> svn add kadr.polon.p 
> svn commit -m 1
> cat >>kadr.polon.p <<EOF
> 
> /**/
> EOF
> svn diff
> exit
> =========
> 
> in a directory with the original file and get
> 
> ===================================================================
> --- kadr.polon.p	(revision 1)
> +++ kadr.polon.p	(working copy)
> @@ -461,6 +461,8 @@
>     EMPTY TEMP-TABLE tt_tytnauk.
>     EMPTY TEMP-TABLE tt_stnauk.
>     pOstatni = vIlosc.
> +   IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
> +END.
>     IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
>  END.
>  {ws_i/log.i}
> 
> as the diff.
> 
> But happens only with this specific file; can't reproduce with
> other content.
> 

Does the file (either before or after the append) contain two identical
lines?  If so, could you try replacing each line in the file by a unique
string?  You can do that with

% perl -lne 'print $h{$_} ||= $unique++' \
  <kadr.polon.p >kadr.polon.p.anonymized


> Andreas
> 
> -- 
> "Totally trivial. Famous last words."
> From: Linus Torvalds <torvalds@*.org>
> Date: Fri, 22 Jan 2010 07:29:21 -0800

Re: Problem with diff

Posted by Andreas Krey <a....@gmx.de>.
On Mon, 17 Oct 2011 14:21:02 +0000, Adam Miazga wrote:
> Hi.
> 
> I have one "magick" file (in attachment).
> I commit this file to repository. I add line
> "/**/"
> into end of file. And again I commit the file to repository.
> 
> When i invoke "svn diff -r n:m kadr.polon.p" i recive
> 
> in Subversion 1.6
> Index: kadr.polon.p
> ===================================================================
> --- kadr.polon.p        (revision 7)
> +++ kadr.polon.p        (revision 8)
> @@ -463,3 +463,5 @@
>    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
> END.
> {ws_i/log.i}
> +
> +/**/

Same here (with -rc2, actually). Run:

=========
#!/bin/sh
rm -rf svntmp
mkdir svntmp
cd svntmp
svnadmin create repo
svn checkout file://`pwd`/repo wc
cd wc
cp ../../kadr.polon.p .
svn add kadr.polon.p 
svn commit -m 1
cat >>kadr.polon.p <<EOF

/**/
EOF
svn diff
exit
=========

in a directory with the original file and get

===================================================================
--- kadr.polon.p	(revision 1)
+++ kadr.polon.p	(working copy)
@@ -461,6 +461,8 @@
    EMPTY TEMP-TABLE tt_tytnauk.
    EMPTY TEMP-TABLE tt_stnauk.
    pOstatni = vIlosc.
+   IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
+END.
    IF vIlosc = (pStart + pIlosc - 1) then leave Global_loop.
 END.
 {ws_i/log.i}

as the diff.

But happens only with this specific file; can't reproduce with
other content.

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800