Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Apr 2002 20:11:40 -0400
From:      Garance A Drosihn <drosih@rpi.edu>
To:        arch@FreeBSD.ORG
Cc:        "M. Warner Losh" <imp@village.org>, freebsd-standards@FreeBSD.ORG
Subject:   Re: diff & patch problem with 'No newline'
Message-ID:  <p05111715b8ee4710a108@[128.113.24.47]>
In-Reply-To: <p05101422b88ba26bec5e@[128.113.24.47]>
References:  <200202091752.g19HqFP11551@green.bikeshed.org> <p05101421b88b76a6aa12@[128.113.24.47]> <20020210040158.A26957@chiark.greenend.org.uk> <p05101422b88ba26bec5e@[128.113.24.47]>

next in thread | previous in thread | raw e-mail | index | archive | help
Back in February, there was a discussion on the freebsd-standards
list about the behavor of freebsd's 'diff' and 'patch' with
respect to files which do not have a final newline character.
The latest gnu-diff command will create a patch which includes
the line:

     \ No newline at end of file

if the last line of the file is changed, and if it does not
have a newline character.  Our 'diff' does not do this,
because we specifically changed it to not do this.  This was
done because our older version of patch does not know what
to do with the line.  Back at the time, I blithely said:

At 11:20 PM -0500 2/9/02, Garance A Drosihn wrote:
>At 4:01 AM +0000 2/10/02, Tony Finch wrote:
>>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.

And now, a mere two months later, I finally looked into it.
Changing 'diff' is trivial, but the main issue is changing
'patch' to match.

I found out that NetBSD had made changes to 'patch' so it
does understand these lines.  I copy&pasted those changes
into our version, and it looks like it works right.  The
patch is pretty straightforward, and I would like to get
it into our patch in for 4.6-release (along with the minor
change to 'diff').  Any objections?

-- 
Garance Alistair Drosehn            =   gad@gilead.netel.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?p05111715b8ee4710a108>