From owner-freebsd-standards Sat Feb 9 9:52:20 2002 Delivered-To: freebsd-standards@freebsd.org Received: from green.bikeshed.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id EF94337B419; Sat, 9 Feb 2002 09:52:16 -0800 (PST) Received: from localhost (green@localhost) by green.bikeshed.org (8.11.6/8.11.6) with ESMTP id g19HqFP11551; Sat, 9 Feb 2002 12:52:15 -0500 (EST) (envelope-from green@green.bikeshed.org) Message-Id: <200202091752.g19HqFP11551@green.bikeshed.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: "M. Warner Losh" Cc: fyre@orbital.wiretapped.net, tim@robbins.dropbear.id.au, freebsd-standards@FreeBSD.ORG Subject: Re: diff problem In-Reply-To: Message from "M. Warner Losh" of "Fri, 08 Feb 2002 23:23:56 MST." <20020208.232356.28086539.imp@village.org> From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 09 Feb 2002 12:52:15 -0500 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 "M. Warner Losh" wrote: > In message: <20020209140259.A51448@descent.robbins.dropbear.id.au> > Tim Robbins writes: > : GNU diff, from diffutils 2.7 did give a warning before it was locally > : hacked to pieces. This is the relevant change: > : > : diff --show-c-function -ru diffutils-2.7/util.c /usr/src/contrib/diff/util.c > : --- diffutils-2.7/util.c Sat Oct 1 15:14:15 1994 > : +++ /usr/src/contrib/diff/util.c Wed Sep 20 13:24:32 2000 > : @@ -480,7 +485,7 @@ print_1_line (line_flag, line) > : output_1_line (text, limit, flag_format, line_flag); > : > : if ((!line_flag || line_flag[0]) && limit[-1] != '\n') > : - fprintf (out, "\n\\ No newline at end of file\n"); > : + fputc ('\n', out); > : } > : > : /* Output a line from TEXT up to LIMIT. Without -t, output verbatim. > : > : Commit message for the reverse of this: > : == > : revision 1.3 > : date: 2000/07/24 07:40:02; author: green; state: Exp; lines: +2 -3 > : Get rid of the stupid bug where diff sticks trash in your generated > : diff output; there being no trailing newline caused it to bitch and > : moan and ruin diffs. That's dumb, if I may say so myself. > : > : Yes, this file is coming off the vendor branch. It hasn't been > : updated in 6 years. > : > : Approved by: peter > : == > : > : When a file is missing the final newline, GNU diff 2.7 and GNU patch 2.5.4 > : can reconstruct the file correctly. > : > : I have absolutely no idea why we have both version 2.5 and version 2.1 of > : patch in the tree. 2.5 lives in /usr/src/contrib/patch, 2.1 lives in > : /usr/src/gnu/usr.bin/patch. Version 2.1 ends up in /usr/bin, version 2.5 > : is not installed anywhere I can find. > : > : IMO patch 2.1 should be installed as 'patch21' or similar, patch 2.5 should > : be actually installed(!!) and the "stupid bug" patch to GNU diff should be > : rolled back. I will submit a problem report on this. > : > : The standards don't specify what should be done when the file is missing > : a trailing newline so this isn't really a standards matter. > > I'd like to revert this change. The main reason is that gnupatch can > reconstruct files that have missing stuff at the end, and subversion > whines that FreeBSD's diff is bogus. Do I get to whine that subversion's non-standard use of pseudo-diff lines is bogus, then? All told, I'd actually rather our diff would refuse to act upon files that have no end-line. Encourage people to use non-stupid editing tools that conform to the way things have been done for decades. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org <> bfeldman@tislabs.com \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message