Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Dec 2010 16:43:44 -0500
From:      Francisco Reyes <lists@stringsutils.com>
To:        Free BSD Questions list <freebsd-questions@freebsd.org>
Subject:   Reversed (or previously applied) patch detected
Message-ID:  <cone.1293486224.208998.9682.1000@shelca>

next in thread | raw e-mail | index | archive | help
I was doing some exercises to get familiar with diff/patch.

Tried:
cd
mkdir tmp
cd tmp
mkdir original
mkdir changed
echo Line1 > original/File1
echo Line2 >>original/File1
echo Line4 >>original/File1

echo Line1 > changed/File1
echo Line2 >>changed/File1
echo Line3 >>changed/File1
echo Line4 >>changed/File1

echo 1 > original/File2
echo 2 >>original/File2
echo 4 >>original/File2

echo 1 > changed/File2
echo 2 >>changed/File2
echo 3 >>changed/File2
echo 4 >>changed/File2

diff -urN original changed > dir.diff

Which produced:
diff -ruN original/File1 changed/File1
--- original/File1      2010-12-26 23:07:41.000000000 -0500
+++ changed/File1       2010-12-26 23:08:26.000000000 -0500
@@ -1,3 +1,5 @@
 Line1
 Line2
+Line3
 Line4
+Line5
diff -ruN original/File2 changed/File2
--- original/File2      2010-12-26 23:08:08.000000000 -0500
+++ changed/File2       2010-12-26 23:08:35.000000000 -0500
@@ -1,3 +1,8 @@
 1
 2
+3
 4
+5
+6
+7
+8


Then tried
patch < dir.diff


The patch command gives the warning:
Reversed (or previously applied) patch detected

Tried a few other variations like
patch -p <dir.diff

It will run without errors with
patch -R < dir.diff

But that will make the "changed" files be like the original instead of 
patching the original files.

Any ideas/hints?  



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