You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ben Collins-Sussman <su...@collab.net> on 2002/03/14 20:47:52 UTC
diff3 problems
Some of you may have noticed that basic_tests.py #5 and #6 are failing
suddenly. Here's the story.
Those tests perform merges; so obviously, they're most likely to be
affected by our switch to diff3 yesterday.
As I was getting ready to commit the "use diff3" changeset, I
discovered that test #5 was suddenly receiving an extra final newline
in the merged text -- a newline that it wasn't expecting. I just
shrugged and assumed that it was some tiny nuance of using diff3
instead of diff+patch. So I changed the test to expect the extra
final newline, and made my commit.
Now it seems that gstein, kfogel, and others are getting test 5
*failures* for exactly this reason: the test is expecting an extra
final newline, but diff3 isn't producing it!
My fear is that this is another Linux/BSD discrepancy.
--> The back-story is that a long, long time ago we discovered that
FreeBSD's version of 'GNU diff' was actually a *hacked* version.
The FreeBSD team removed a GNU-specific feature that allowed the
program to operate on textfiles that had no final newlines. I'm
not sure why they did this, but it screwed up our diff+patch
merging process on FreeBSD. That's why we had an autoconf test
to look for a "non-broken" GNU diff program.
Of course, I removed that autoconf test yesterday, since we no longer
needed that specific diff+patch behavior. The great Irony is that now
I'm suspicious that we're experiencing the *exact* same problem with
diff3!
We need to examine the exact 3 fulltexts are being merged by diff3 in
basic_test #5, and then see if we can reproduce different behaviors on
different operating systems. Anyone want to look into this? If not,
I'll probably take a look soon. In the meantime, we might want to
change test #5's expectations back to *not* expecting the extra
newline.
(As for test #6, I'm not sure what the deal is -- the actual conflict
markers look very different than the 'expected' ones that I recently
pasted into the test from my FreeBSD box. This also needs
investigation.)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: diff3 problems
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Thu, Mar 14, 2002 at 02:47:52PM -0600, Ben Collins-Sussman wrote:
> My fear is that this is another Linux/BSD discrepancy.
damn it. and i was getting all excited about removing the freebsd
port's dependency on gdiff3. should have known it was too good to be
true.
-garrett
--
garrett rooney Unix was not designed to stop you from
rooneg@electricjellyfish.net doing stupid things, because that would
http://electricjellyfish.net/ stop you from doing clever things.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: diff3 problems
Posted by Greg Hudson <gh...@MIT.EDU>.
On Thu, 2002-03-14 at 16:37, Thom May wrote:
> Just tested this on OpenBSD-current, and on there diff3 is _not_ adding a
> newline.
I'd like to remind everyone that diff3 works by invoking "diff" on pairs
of files from the command line, and merging those diffs.
So, on OpenBSD and NetBSD, diff3 will do the right thing because they
have an unmodified diff command. (Which can generate diffs which their
own "patch" commands can't understand.)
On FreeBSD, diff3 will do the wrong thing because diff has been crippled
to work with patch.
Nothing surprising here.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: diff3 problems
Posted by Thom May <th...@planetarytramp.net>.
* Garrett Rooney (rooneg@electricjellyfish.net) wrote :
> On Thu, Mar 14, 2002 at 03:24:14PM -0600, Ben Collins-Sussman wrote:
> > Ben Collins-Sussman <su...@collab.net> writes:
> >
> > > My fear is that this is another Linux/BSD discrepancy.
> >
> > Oh, lordy. Here we go again. Karl and I came up with a script that
> > produces *different* behavior on FreeBSD vs. Linux. Everyone take a
> > look at this script, or try it out. On Linux, there's no extra
> > newline added. On FreeBSD, there is.
> >
> > (Note that my FreeBSD's 'diff3' binary still claims to be version 2.7,
> > from GNU diffutils. I wonder if it's hacked, though...)
>
> i imagine it's the same kind of issue as we had with FreeBSD's diff and
> patch. they may claim to be the GNU versions, but they are hacked.
> you can confirm it by checking the version in FreeBSD cvs if you want,
> but the fact that you have a script that produces different results
> indicates to me that we'll need to go to searching for gnu diff3 like
> we used to do for patch and diff. it sucks, but if that's what we
> have to do, that's what we have to do.
>
> -garrett
>
Just tested this on OpenBSD-current, and on there diff3 is _not_ adding a
newline.
21:37 eulogy:~% diff3 --version
diff3 - GNU diffutils version 2.7
21:37 eulogy:~% uname -a
OpenBSD eulogy 3.0 EULOGY#0 i386
just FYI.
-Thom
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: diff3 problems
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Thu, Mar 14, 2002 at 03:24:14PM -0600, Ben Collins-Sussman wrote:
> Ben Collins-Sussman <su...@collab.net> writes:
>
> > My fear is that this is another Linux/BSD discrepancy.
>
> Oh, lordy. Here we go again. Karl and I came up with a script that
> produces *different* behavior on FreeBSD vs. Linux. Everyone take a
> look at this script, or try it out. On Linux, there's no extra
> newline added. On FreeBSD, there is.
>
> (Note that my FreeBSD's 'diff3' binary still claims to be version 2.7,
> from GNU diffutils. I wonder if it's hacked, though...)
i imagine it's the same kind of issue as we had with FreeBSD's diff and
patch. they may claim to be the GNU versions, but they are hacked.
you can confirm it by checking the version in FreeBSD cvs if you want,
but the fact that you have a script that produces different results
indicates to me that we'll need to go to searching for gnu diff3 like
we used to do for patch and diff. it sucks, but if that's what we
have to do, that's what we have to do.
-garrett
--
garrett rooney Unix was not designed to stop you from
rooneg@electricjellyfish.net doing stupid things, because that would
http://electricjellyfish.net/ stop you from doing clever things.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: diff3 problems
Posted by Eric Gillespie <ep...@pretzelnet.org>.
Ben Collins-Sussman <su...@collab.net> writes:
> Ben Collins-Sussman <su...@collab.net> writes:
>> My fear is that this is another Linux/BSD discrepancy.
> Oh, lordy. Here we go again. Karl and I came up with a script
> that produces *different* behavior on FreeBSD vs. Linux.
> Everyone take a look at this script, or try it out. On Linux,
> there's no extra newline added. On FreeBSD, there is.
I don't get the extra newline on Mac OS X, Debian GNU/Linux, or NetBSD
(current). On all three platforms i get the following identical
output:
This is a non-conflicting change to line 1.
This is line 2.
This is line 3.
This is line 4.
This is line 5.
This is line 6.
This is line 7.
This is line 8.
This is line 9.
This is line 10 plus some, but still no trailing newline.XXX
(If the XXX appears at the end of line 10, then your diff3 does not
...
NetBSD:
0 ~% diff3 --version
diff3 - GNU diffutils version 2.7
0 ~% which diff3
/usr/bin/diff3
Debian:
0 ~% diff3 --version
diff3 - GNU diffutils version 2.7
0 ~% which diff3
/usr/bin/diff3
Mac OS X:
0 ~% diff3 --version
diff3 - GNU diffutils version 2.7
0 ~% which diff3
/usr/bin/diff3
--
Eric Gillespie, Jr. <*> epg@pretzelnet.org
Conformity is a sin.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: diff3 problems
Posted by Ben Collins-Sussman <su...@collab.net>.
Greg Stein <gs...@lyra.org> writes:
> On Thu, Mar 14, 2002 at 03:52:30PM -0600, Ben Collins-Sussman wrote:
> >...
> > So I guess the only thing to do is put in a new ac-helper test. We
> > can use the recently-posted script to check for a legitimate diff3;
> > but a new calling script should attempt to hunt down binaries not only
> > named 'diff3', but 'gdiff3' as well. (That's how FreeBSD
> > differentiates between the version that comes in the base system,
> > vs. the one built from the diffutils port.)
>
> Have you run your own test against gdiff3 on your BSD box? IOW, does gdiff3
> work fine (no extra newline), while diff3 adds the newline?
Yup, gdiff3 is all good on BSD. diff3 is bad.
> Also, I noticed in your test that you used "echo -n" which isn't portable to
> some echo scripts. Just a test script, sure, but when it goes into the
> ./configure-time test, it needs to do the ECHO_N and ECHO_C magic.
Check.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: diff3 problems
Posted by Greg Stein <gs...@lyra.org>.
On Thu, Mar 14, 2002 at 03:52:30PM -0600, Ben Collins-Sussman wrote:
>...
> So I guess the only thing to do is put in a new ac-helper test. We
> can use the recently-posted script to check for a legitimate diff3;
> but a new calling script should attempt to hunt down binaries not only
> named 'diff3', but 'gdiff3' as well. (That's how FreeBSD
> differentiates between the version that comes in the base system,
> vs. the one built from the diffutils port.)
Have you run your own test against gdiff3 on your BSD box? IOW, does gdiff3
work fine (no extra newline), while diff3 adds the newline?
Also, I noticed in your test that you used "echo -n" which isn't portable to
some echo scripts. Just a test script, sure, but when it goes into the
./configure-time test, it needs to do the ECHO_N and ECHO_C magic.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: diff3 problems
Posted by Ben Collins-Sussman <su...@collab.net>.
Ben Collins-Sussman <su...@collab.net> writes:
> (Note that my FreeBSD's 'diff3' binary still claims to be version 2.7,
> from GNU diffutils. I wonder if it's hacked, though...)
Well, looking at the FreeBSD cvs repository, it's not clear to me
whether they hacked it. Here's the URL:
http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/diff/
I bet diff3.c shares possibly-hacked code with other diff-related
programs, though.
So I guess the only thing to do is put in a new ac-helper test. We
can use the recently-posted script to check for a legitimate diff3;
but a new calling script should attempt to hunt down binaries not only
named 'diff3', but 'gdiff3' as well. (That's how FreeBSD
differentiates between the version that comes in the base system,
vs. the one built from the diffutils port.)
Any volunteers? :-)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: diff3 problems
Posted by Ben Collins-Sussman <su...@collab.net>.
Ben Collins-Sussman <su...@collab.net> writes:
> My fear is that this is another Linux/BSD discrepancy.
Oh, lordy. Here we go again. Karl and I came up with a script that
produces *different* behavior on FreeBSD vs. Linux. Everyone take a
look at this script, or try it out. On Linux, there's no extra
newline added. On FreeBSD, there is.
(Note that my FreeBSD's 'diff3' binary still claims to be version 2.7,
from GNU diffutils. I wonder if it's hacked, though...)
-----------------------
#!/bin/sh
### Invoke with no arguments to see if your diff3 adds an extra
### newline to its output when the input lacks a final newline.
###
### Note: You need 'echo -n' for this script to work right.
## Set up older.txt
echo "This is line 1." > older.txt
echo "This is line 2." >> older.txt
echo "This is line 3." >> older.txt
echo "This is line 4." >> older.txt
echo "This is line 5." >> older.txt
echo "This is line 6." >> older.txt
echo "This is line 7." >> older.txt
echo "This is line 8." >> older.txt
echo "This is line 9." >> older.txt
echo -n "This is line 10." >> older.txt
## Set up mine.txt
echo "This is a non-conflicting change to line 1." > mine.txt
echo "This is line 2." >> mine.txt
echo "This is line 3." >> mine.txt
echo "This is line 4." >> mine.txt
echo "This is line 5." >> mine.txt
echo "This is line 6." >> mine.txt
echo "This is line 7." >> mine.txt
echo "This is line 8." >> mine.txt
echo "This is line 9." >> mine.txt
echo -n "This is line 10." >> mine.txt
## Set up yours.txt
echo "This is line 1." > yours.txt
echo "This is line 2." >> yours.txt
echo "This is line 3." >> yours.txt
echo "This is line 4." >> yours.txt
echo "This is line 5." >> yours.txt
echo "This is line 6." >> yours.txt
echo "This is line 7." >> yours.txt
echo "This is line 8." >> yours.txt
echo "This is line 9." >> yours.txt
echo -n "This is line 10 plus some, but still no trailing newline." >> yours.txt
## Demonstrate the behavior.
diff3 -A -m mine.txt older.txt yours.txt
echo "XXX"
echo ""
echo "(If the XXX appears at the end of line 10, then your diff3 does not"
echo "add a spurious newline. But if the XXX appears on its own line, then"
echo "diff3 added a newline not present in any of the original data; in"
echo "which case, please mail dev@subversion.tigris.org stating your"
echo "operating system and the output of 'diff3 --version'.)"
echo ""
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org