From owner-freebsd-arch Thu Apr 25 17:11:54 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id 9DA1737B404; Thu, 25 Apr 2002 17:11:43 -0700 (PDT) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.12.1/8.12.1) with ESMTP id g3Q0Bfn5025092; Thu, 25 Apr 2002 20:11:42 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: <200202091752.g19HqFP11551@green.bikeshed.org> <20020210040158.A26957@chiark.greenend.org.uk> Date: Thu, 25 Apr 2002 20:11:40 -0400 To: arch@FreeBSD.ORG From: Garance A Drosihn Subject: Re: diff & patch problem with 'No newline' Cc: "M. Warner Losh" , freebsd-standards@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang) Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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-arch" in the body of the message