Re: [DOCS] 6.5.3 diff

From: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, webmaster(at)postgreSQL(dot)org, PostgreSQL-documentation <docs(at)postgreSQL(dot)org>
Subject: Re: [DOCS] 6.5.3 diff
Date: 1999-11-09 01:21:30
Message-ID: 3827771A.D7B402DD@wgcr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The Hermit Hacker wrote:
>
> On Mon, 8 Nov 1999, Bruce Momjian wrote:
>
> > > The Hermit Hacker wrote:
> > > >
> > > > Not what program, what set of arguments for the diff command...no matter
> > > > what I seem to try, someone doesn't like the patch :)
> > >
> > > There's so many different arguments.... 'diff -uNr postgresql-6.5.x.orig
> > > postgresql-6.5.x' works for me, and is what I use in preparing the
> > > patchsets for the RPM's. Of course, that presupposes that there is a
> > > whole '.orig' tree laying around to diff against, but I fugre that's a
> > > given.
> > >
> >
> > While we are on the topic, can someone explain why unified diffs are
> > better than context diffs. I find unified diffs hard to read.
>
> Damn, hadn't clued into the -u :( unified diffs, I believe, are smaller,
> and in doing a v6.5.x->v6.5.x+1 patch, are fine...context diffs contain
> more "surrounding code", so that if someone else has made changes, the
> patch command can generally find where the code has moved to. That is why
> we only generally accept context diffs for the source tree, since its such
> a moving target...
>
> And, if none of the above made sense, no worries...its barely making sense
> to me too :(

Now that you mention it that way, it makes perfect sense to me. For the
packaging of a specific version of a program, a unified diff makes
sense, as it's smaller, yet more readable than a 'regular' or 'ed' diff.

For patches against a moving target (the CVS source tree patches you
mentioned), you want more context so that patch (and developers) can
more easily figure out what's going on. However, regular context diffs
don't give you MORE context -- they just give you the context twice,
once for each file.

You can also specify the number of lines of context (or unified
context). Unified context is a modification of regular context that is
more compact. This compaction is achieved by eliminating redundant
context -- which is why it might, under certain circumstances, be more
difficult to read. Regular context diff output contains the context
from both files -- the unified format shows common context only once,
and labels the lines from the two files for only the differences (all
this taken from the diff info page).

HOWEVER, unified diffs have their problems -- mainly that, unless I am
mistaken, only the GNU diff and GNU patch can handle them.

It's like a light bulb clicked on.... and I have learned something
interesting today!

--
Lamar Owen
WGCR Internet Radio

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message neil d. quiogue 1999-11-09 08:30:02 Re: [DOCS] 6.5.3 diff
Previous Message The Hermit Hacker 1999-11-09 00:24:53 Re: [DOCS] 6.5.3 diff