Problems with whitespace-ignoring diff options

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Problems with whitespace-ignoring diff options
Date: 2003-11-01 03:06:00
Message-ID: Pine.LNX.4.44.0311010358320.1528-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On OpenBSD 3.4, the diff options -b and -w have the interesting feature
(actually listed as a bug) that they ignore whitespace for preparing the
diff, but the exit status will be 1 nonetheless, if the files are at all
different. This leads to several failures in the current regression
tests, because the expected files are off by some whitespace.

It appears we must not use the options for determining whether the test
failed, only for creating the diff output. Or does anyone have a better
idea?

--
Peter Eisentraut peter_e(at)gmx(dot)net


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problems with whitespace-ignoring diff options
Date: 2003-11-01 04:51:57
Message-ID: 22315.1067662317@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> It appears we must not use the options for determining whether the test
> failed, only for creating the diff output. Or does anyone have a better
> idea?

AFAIK, there is no reason to ignore whitespace in determining whether a
test succeeded. However, if a test fails, it is quite likely that a
whitespace-sensitive diff will produce many lines of uninteresting diff,
because of psql's habit of justifying column output --- any difference
in the data value length where the actual difference occurs would impact
all the rest of the query output, even though it's really "the same".

So if you can implement the above behavior easily, go for it.

Keep in mind though that a reported failure accompanied by *no* visible
diff would be highly annoying ;-). Can we arrange to produce a
whitespace-sensitive diff output if the whitespace-insensitive kind
shows nothing?

regards, tom lane


From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Problems with whitespace-ignoring diff options
Date: 2003-11-01 16:11:58
Message-ID: 87llr09igh.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> However, if a test fails, it is quite likely that a whitespace-sensitive
> diff will produce many lines of uninteresting diff, because of psql's habit
> of justifying column output

Perhaps the regression tests should just do \pset format unaligned ?

--
greg