From owner-freebsd-current Sat Jan 10 22:38:46 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id WAA23656 for current-outgoing; Sat, 10 Jan 1998 22:38:46 -0800 (PST) (envelope-from owner-freebsd-current) Received: from ache.relcom.ru (ache@ache.relcom.ru [193.125.20.108]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id WAA23599 for ; Sat, 10 Jan 1998 22:38:20 -0800 (PST) (envelope-from ache@ache.relcom.ru) Received: (from ache@localhost) by ache.relcom.ru (8.8.8/8.8.8) id CAA00801; Sun, 11 Jan 1998 02:18:09 +0300 (MSK) (envelope-from ache) Date: Sun, 11 Jan 1998 02:18:06 +0300 (MSK) From: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= X-Sender: ache@ache.relcom.ru To: Peter Wemm , info-cvs@gnu.ai.mit.edu cc: Mike Smith , FreeBSD-current , Joerg Wunsch Subject: CVS patch to produce correct diffs (-L used now) In-Reply-To: <199801101810.CAA08076@spinner.netplex.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Since "patch" expecially ignore Index: lines for context diffs according to POSIX 1003.2b/D11 section 5.22.7.2 and current practice for GNU "patch" (any version), CVS need mechanism to produce correct pathnames in patches made by 'cvs diff' command. The simple way to do it (already adopted by rcsdiff) is using -L option for diff to specify alternative ***/--- labels. Proposed patch included below: *** src/diff.c.orig Sat May 24 23:48:15 1997 --- src/diff.c Sun Jan 11 01:53:17 1998 *************** *** 568,574 **** if (empty_file == DIFF_ADDED) { if (use_rev2 == NULL) ! run_setup ("%s %s %s %s", DIFF, opts, DEVNULL, finfo->file); else { int retcode; --- 568,576 ---- if (empty_file == DIFF_ADDED) { if (use_rev2 == NULL) ! run_setup ("%s %s -L%s -L%s %s %s", DIFF, opts, ! DEVNULL, finfo->fullname, ! DEVNULL, finfo->file); else { int retcode; *************** *** 589,595 **** } /* FIXME: what if retcode > 0? */ ! run_setup ("%s %s %s %s", DIFF, opts, DEVNULL, tmp); } } else --- 591,599 ---- } /* FIXME: what if retcode > 0? */ ! run_setup ("%s %s -L%s -L%s %s %s", DIFF, opts, ! DEVNULL, finfo->fullname, ! DEVNULL, tmp); } } else *************** *** 610,630 **** } /* FIXME: what if retcode > 0? */ ! run_setup ("%s %s %s %s", DIFF, opts, tmp, DEVNULL); } } else { if (use_rev2) { ! run_setup ("%s%s -x,v/ %s %s -r%s -r%s", Rcsbin, RCS_DIFF, opts, *options ? options : vers->options, ! use_rev1, use_rev2); } else { ! run_setup ("%s%s -x,v/ %s %s -r%s", Rcsbin, RCS_DIFF, opts, ! *options ? options : vers->options, use_rev1); } run_arg (vers->srcfile->path); } --- 614,636 ---- } /* FIXME: what if retcode > 0? */ ! run_setup ("%s %s -L%s %s %s", DIFF, opts, ! finfo->fullname, tmp, DEVNULL); } } else { if (use_rev2) { ! run_setup ("%s%s -x,v/ %s %s -r%s -r%s -L%s", Rcsbin, RCS_DIFF, opts, *options ? options : vers->options, ! use_rev1, use_rev2, finfo->fullname); } else { ! run_setup ("%s%s -x,v/ %s %s -r%s -L%s", Rcsbin, RCS_DIFF, opts, ! *options ? options : vers->options, use_rev1, ! finfo->fullname); } run_arg (vers->srcfile->path); } -- Andrey A. Chernov http://www.nagual.pp.ru/~ache/