Date: Sun, 08 Oct 2000 20:59:18 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: rich AT phekda DOT freeserve DOT co DOT uk Message-Id: <3099-Sun08Oct2000205918+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.5h CC: djgpp-workers AT delorie DOT com In-reply-to: <39E0B5A5.B1C9E9FE@phekda.freeserve.co.uk> (message from Richard Dawe on Sun, 08 Oct 2000 18:57:57 +0100) Subject: Re: Bizarre patch behaviour References: <39E06A7C DOT 9BD27470 AT phekda DOT freeserve DOT co DOT uk> <3028-Sun08Oct2000173759+0300-eliz AT is DOT elta DOT co DOT il> <39E0B5A5 DOT B1C9E9FE AT phekda DOT freeserve DOT co DOT uk> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Sun, 08 Oct 2000 18:57:57 +0100 > From: Richard Dawe > > Eli Zaretskii wrote: > > Take a look at the section named "NOTES FOR PATCH SENDERS" in the > > Patch man page. You have violated one of the rules it sets: not to > > produce diffs where the OLD and the NEW files have different number of > > slashes. This is especially important if the patch is supposed to be > > applied with the -pN switch, as you did. > > Oops, you are quite right. The info docs don't seem to mention this, as > far as I can tell. The Info docs are terribly outdated, as far as Patch is concerned (they are accurate about Diff and friends, though); I think there's a note somewhere in the Patch distro about this. You should use the Patch man page instead. > I wonder if this should be added to: > > info diffutils 'Making Patches' > > just to clarify for ignorant people like me. ;) Sure. Feel free to suggest this to Paul Eggert, the maintainer of Diffutils and Patch (although I imagine that he knows). > > Because Patch uses some complicated guesswork to find out which file > > to apply the patch to (it's not easy, contrary to how it sounds), and > > that guesswork sometimes breaks. > > Oh, OK, I thought it only used the first filename and ignored the second. It can't, in general. If it did, the following wouldn't DTRT: diff -c foo.c~ foo.c > foo.dif patch -p0 < foo.dif This example is very frequently seen, and the second file name is the one you want Patch to pick up in such cases.