Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Apr 1997 14:00:02 -0800 (PST)
From:      j@uriah.heep.sax.de (J Wunsch)
To:        freebsd-bugs
Subject:   Re: gnu/3176: `patch' creates files in wrong places (following Index)
Message-ID:  <199704022200.OAA27937@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR gnu/3176; it has been noted by GNATS.

From: j@uriah.heep.sax.de (J Wunsch)
To: charnier@xp11.frmug.org
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: gnu/3176: `patch' creates files in wrong places (following Index)
Date: Wed, 2 Apr 1997 23:47:14 +0200

 As Philippe Charnier wrote:
 
 > cd a-1.0
 > patch -p1 -N < ../file.patch
 > 	Hmm...  Looks like a unified diff to me...
 > 	The text leading up to this was:
 > 	--------------------------
 > 	|Index: b/file
 > 	|--- /dev/null  Wed Apr  2 20:33:10 1997
 > 	|+++ a-2.0/b/file       Wed Apr  2 21:58:35 1997
 > 	--------------------------
 > 	(Creating file file...)                 <------------- should be b/file
 > 	Patching file file using Plan A...
 > 	Hunk #1 succeeded at 1.
 > 	done
 > 
 > >Fix:
 
 > If the line `Index: b/file' is not provided, the command works as
 > expected. If not, the -p1 option is applied against Index.
 
 This is expected behaviour.
 
    ``The
      Index  line, if present, takes precedence over the context
      diff header.''
 
 Options like -p1 are applied after guessing the filename, so it will
 be applied to `b/file' in your case, stripping the `b/' of it, and
 leaving just `file'.
 
 ``Fixing'' this behaviour would royally screw CVS diffs that heavily
 rely on the Index: magic.
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704022200.OAA27937>