From owner-freebsd-standards Fri Feb 8 18:29:26 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id 9B7E337B41C for ; Fri, 8 Feb 2002 18:29:23 -0800 (PST) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id g192T8p09704; Fri, 8 Feb 2002 21:29:08 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20020208.183640.89249665.imp@village.org> References: <20020208.183640.89249665.imp@village.org> Date: Fri, 8 Feb 2002 21:29:07 -0500 To: "M. Warner Losh" , standards@FreeBSD.ORG From: Garance A Drosihn Subject: Re: diff problem 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-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 6:36 PM -0700 2/8/02, M. Warner Losh wrote: >We have a problem with out diff. Given file foo1 and foo2. foo1 has >a newline at the end, while foo2 doesn't. Diff produces: > >% diff -c ~/foo[12] >*** /dell/imp/foo1 Fri Feb 8 18:05:26 2002 >--- /dell/imp/foo2 Fri Feb 8 18:05:31 2002 >*************** >*** 1 **** >! this is a test >--- 1 ---- >! this is a test >% > >It should produce a warning about no newline at the end of the file, >but doesn't. At least that's my take. What do standards have to say? Well, I wouldn't call it a warning so much as a information/marker line (since it's part of the diff output, and not going to stderr). The SingleUnixSpec v3 does not mention this issue, but I know the gnu version of diff would treat this as: (20) diff gadtest1 gadtest2 1c1 < This is a test --- > This is a test \ No newline at end of file I also know that the fact that our diff does not do *something* useful in this situation is rather irritating to developers of source-code management programs, such as the 'subversion' folks. Now you might say "But isn't that our diff?". Well, yes, but if you check the change log at http://www.FreeBSD.org/cgi/cvsweb.cgi/src/contrib/diff/util.c you'll see that the freebsd project (in 1997) explicitly removed the code which printed out that helpful marker line. You can imagine that this *really* annoys the people who are looking for that informational marker-line to exist... http://cvsweb.netbsd.org/bsdweb.cgi/gnusrc/gnu/dist/diffutils/util.c implies that netbsd's diff does include the marker line. http://www.openbsd.org/cgi-bin/cvsweb/src/gnu/usr.bin/diff/util.c implies that openbsd's diff also includes the marker line. Offhand, I'd say we're the weird one out, and that I don't see any benefit in having a less informative output from diff... -- 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