Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Feb 2002 23:20:52 -0500
From:      Garance A Drosihn <drosih@rpi.edu>
To:        Tony Finch <dot@dotat.at>
Cc:        "Brian F. Feldman" <green@FreeBSD.ORG>, "M. Warner Losh" <imp@village.org>, fyre@orbital.wiretapped.net, tim@robbins.dropbear.id.au, freebsd-standards@FreeBSD.ORG
Subject:   Re: diff problem
Message-ID:  <p05101422b88ba26bec5e@[128.113.24.47]>
In-Reply-To: <20020210040158.A26957@chiark.greenend.org.uk>
References:  <200202091752.g19HqFP11551@green.bikeshed.org> <p05101421b88b76a6aa12@[128.113.24.47]> <20020210040158.A26957@chiark.greenend.org.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
At 4:01 AM +0000 2/10/02, Tony Finch wrote:
>On Sat, Feb 09, 2002 at 09:46:00PM -0500, Garance A Drosihn wrote:
>>
>>  I think that the [GNUish] behavior is the most useful and thus the most
>>  desirable one, from a purely practical point of view.  The point of
>>  'diff' is to tell the person the difference between two files, it is
>>  not there to slap the wrists of someone for using the "wrong tool"
>>  to work on some file.  When it comes to following standards, freebsd
>>  can't claim to be following anyone that I can see.
>
>FreeBSD is following a pedantic reading of SUS.

I meant, the behavior of any current operating system.  You could argue
that AIX and Solaris are following that pedantic reading too, but at
least they tell the user (via stderr) about that missing newline.

It should also be acknowledged that the pedantic reading of diff does
not acknowledge this issue at all.  Ie, if you follow the exact output
formats as specified, then there *is* no way to indicate the situation
where the last line is missing a newline character.  That's what I meant
by the 'group 5' behavior being the most useful.  It's the only one
which allows someone to recreate the second file by using the first file
and the output from 'diff'.  That should count for something.  That
marker line isn't a change for the sake of change, it was done to
address an oversight and a shortcoming in the standard as written.

>It is also useful to refer to `patch` when we talk about `diff`, since
>the former is defined (in SUS) in terms of the latter. And you also
>must consider how these tools interact with the revision management
>systems that the project uses.

This is true.  As I mentioned, if we need to fix patch to understand
the extra line, then we should do that.  Chances are we should do that
anyway, in case someone sends us a patch generated from the diff on
the list of operating systems I listed as 'group 5'.

If no other operating system had this extra marker line, then I would
be reluctant to have FreeBSD add it.  However, given how much of the
unix world considers that extra line as "standard", including the two
other BSD's, then I think it's a good idea for us to also support it.

-- 
Garance Alistair Drosehn            =   gad@eclipse.acs.rpi.edu
Senior Systems Programmer           or  gad@freebsd.org
Rensselaer Polytechnic Institute    or  drosih@rpi.edu

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-standards" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p05101422b88ba26bec5e>