Mail Archives: djgpp-workers/2000/10/08/14:58:10
> Date: Sun, 08 Oct 2000 18:57:57 +0100
> From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
>
> 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.
- Raw text -