bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: diff -b does not actually work with newlines


From: David Kastrup
Subject: Re: diff -b does not actually work with newlines
Date: Sun, 15 Jul 2007 19:48:10 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

Dan Hipschman <address@hidden> writes:

> On Fri, Jul 13, 2007 at 08:21:45PM +0200, David Kastrup wrote:
>> Could you explain how you figure that diff -b is working as specified?
>
> $ diff --help | head -n 2
> Usage: /usr/bin/diff [OPTION]... FILES
> Compare files line by line.
>
> Also, in the man page:
>
>       diff - compare files line by line
>
> That's the core functionality of diff, to compare lines.

You conveniently snipped the info page I quoted.  The info page _for_
_whitespace_ (certainly the most relevant page for those options)
explicitly lists newlines as whitespace, and explicitly states that
all whitespace is ignored in comparison.

So it is wrong, as comparison with the Posix definition shows (which
explicitly exempts newlines).

I don't quite get the point of you pretending that I am a moron
incapable to read which you do by snipping out all the relevant
documentation I cited and instead providing some very wishywashy
circumstancial evidence that _could_ be interpreted to contradict the
info page.

But that's not important.  Important is that there is a _definite_
need to compare text documents for _significant_ non-whitespace
changes, namely where newlines are equivalent to spaces (possibly with
an extra option to treat multiple newlines separately because they
might indicate a "hard newline" separating paragraphs).

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum





reply via email to

[Prev in Thread] Current Thread [Next in Thread]