help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

diff/patch with subdirectories


From: Guy Rouillier
Subject: diff/patch with subdirectories
Date: Tue, 29 Jun 2004 17:35:40 -0000
User-agent: Pan/0.14.2.91 (As She Crawled Across the Table)

I'm trying to prepare a patch to submit to the kernel PPP people.  I'm
having trouble figuring out how to generate this properly.   As a test,
I created  two files "abc" and "def", with contents the same as the file
names.  If I generate a diff using this command:

diff -u abc def > abc.diff

I end up with this diff output:

--- abc 2004-06-13 00:22:41.825421456 -0400
+++ def 2004-06-12 00:15:52.000000000 -0400
@@ -1 +1 @@
-abc
+def

Running "patch <abc.diff" patches the file abc without a problem, as
expected.

However, if I now create two subdirectories called "from" and "to", each
containing a file called "aaa"  (with different contents) and run 

diff -u from to > sub.diff

I end up with this:

--- from/aaa    2004-06-13 00:27:54.349910512 -0400
+++ to/aaa      2004-06-13 00:28:15.889635976 -0400
@@ -1 +1 @@
-abc
+def

Now running patch produces this:

patch -u -p0 <sub.diff
patching file to/aaa
Reversed (or previously applied) patch detected!  Assume -R? [n]

The diff file looks identical to the one generated for two files in the
same directory, but patch is reporting that it is trying to patch the
"to" file instead of the "from" file.  I've googled to no avail.   Can 
someone explain what I've done incorrectly to confuse patch, and how I'm
supposed to do this?  Thanks much.

-- 
Guy Rouillier



reply via email to

[Prev in Thread] Current Thread [Next in Thread]