Subject: Reverse-patching empty files
To: None <tech-userlevel@netbsd.org>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-userlevel
Date: 08/22/2006 10:57:01
Hi,
A test case in Monotone tries to apply a patch to an empty file in
reverse form. This works OK with GNU patch (2.5.9) but fails with
ours. Consider the following commands which illustrate the problem:
$ echo 1 >foo.old
$ echo 2 >>foo.old
$ touch foo
$ diff -u foo.old foo >patch.diff
$ patch -p0 -R <patch.diff
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- foo.old 2006-08-22 10:55:49.000000000 +0200
|+++ foo 2006-08-22 10:55:49.000000000 +0200
--------------------------
Patching file foo using Plan A...
Hunk #1 failed at 1.
1 out of 1 hunks failed--saving rejects to foo.rej
done
Is this a bug in our patch? Or there is nothing that requires it to
behave this way?
Thanks.
--
Julio M. Merino Vidal <jmmv84@gmail.com>
The Julipedia - http://julipedia.blogspot.com/