From owner-freebsd-current Mon Jan 12 15:58:54 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id PAA22726 for current-outgoing; Mon, 12 Jan 1998 15:58:54 -0800 (PST) (envelope-from owner-freebsd-current) Received: from most.weird.com (most.weird.com [204.92.254.2]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id PAA22647 for ; Mon, 12 Jan 1998 15:58:02 -0800 (PST) (envelope-from woods@mail.weird.com) Received: from localhost (3668 bytes) by most.weird.com via sendmail with P:stdio/R:bind_hosts/T:inet_zone_bind_smtp (sender: ) (ident using unix) id for ; Mon, 12 Jan 1998 18:56:20 -0500 (EST) (Smail-3.2.0.102-Pre 1997-Dec-17 #5 built 1998-Jan-8) Message-Id: Date: Mon, 12 Jan 1998 18:56:20 -0500 (EST) From: woods@most.weird.com (Greg A. Woods) To: Joerg Wunsch Cc: =?iso-8859-1?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= , Peter Wemm , FreeBSD-current , info-cvs@gnu.org Subject: Re: CVS DIFF fix for review (-L added) In-Reply-To: J. Wunsch's message of "Mon, January 12, 1998 08:20:22 +0100" regarding "Re: CVS DIFF fix for review (-L added)" id <19980112082022.30571@uriah.heep.sax.de> References: <199801111457.WAA06475@spinner.netplex.com.au> <19980112082022.30571@uriah.heep.sax.de> Reply-To: woods@weird.com (Greg A. Woods) X-Mailer: ViewMail (vm) Version 5.96 (beta) with GNU Emacs 19.34.1 (m68k.68881-sun-sunos4.1.1, X toolkit) of Thu Sep 12 1996 on most Organization: Planix, Inc.; Toronto, Ontario; Canada Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk [ On Mon, January 12, 1998 at 08:20:22 (+0100), J. Wunsch wrote: ] > Subject: Re: CVS DIFF fix for review (-L added) > > The idea of Index: was great, but there has never been a patch utility > supporting it the way CVS did expect. :-O Again, all the pre-existant > ``support'' for Index: lines taking precedence over context-diff > headers was _incidentally_. Oh, I beg to differ! It was upon my request that "Index:" was originally added to the `cvs diff' output, specifically to support patch. I think even the last release of patch by Larry Wall contained support for "Index:". However versions of GNU Patch since 2.3.7 have only supported the "Index:" tag when requested by setting the environment variable POSIXLY_CORRECT (or completely omitting filenames in the context header) [see note rule 2]. This from 2.4's manual: If no original file origfile is specified on the command line, patch tries to figure out from the leading garbage what the name of the file to edit is, using the following rules. + If the header is that of a context diff, patch takes the old and new file names in the header. Any /dev/null names are ignored. + If there is an Index: line in the leading garbage and if either the old and new names are both absent or the POSIXLY_CORRECT environment variable is set, patch takes the name in the Index: line. + For the purpose of the following rules, the names are considered to be in the order (old, new, index), regard- less of the order that they appear in the header. + If some of the named files exist, patch uses the first name if the POSIXLY_CORRECT environment variable is set, and the best name otherwise. + If patch is not ignoring RCS and SCCS (see the -g num or --get=num option), and no named files exist but an RCS or SCCS master is found, patch uses the first named file with an RCS or SCCS master. + If no named files exist, no RCS or SCCS master was found, some names are given, POSIXLY_CORRECT is not set, and the patch appears to create a file, patch uses the best name requiring the creation of the fewest directories. Unfortunately POSIX has made life difficult yet again (rule three seems to make the "Index:" header have the least precedence even when it would be more logical to have it the most precedence).... At least now it's all documented and "standard". -- Greg A. Woods +1 416 443-1734 VE3TCP Planix, Inc. ; Secrets of the Weird