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

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

Re: diff/patch with subdirectories


From: Guy Rouillier
Subject: Re: diff/patch with subdirectories
Date: Sun, 27 Jun 2004 22:12:01 -0400
User-agent: Pan/0.14.2.91 (As She Crawled Across the Table)

On Tue, 15 Jun 2004 19:02:39 +0100, Roger Leigh wrote:

> On 2004-06-14, Guy Rouillier <guy-rouillier@speakeasy.net> wrote:
>> --- 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]
> 
> Use "patch -p1 < patchfile" to strip off the top-level of the path.
> 
> At a later stage, if you're generating a patch for a whole directory
> tree, "diff -urN" usually does the right thing.

Roger, thank you for the reply.  I've been away on business and I'm just
getting caught up - I apologize for not responding more promptly.

With the same set of sample inputs, I ran "diff -urN from to >subdir.diff"
and it produced the following:

diff -urN from/aaa to/aaa
--- from/aaa    2004-06-13 00:27:54.000000000 -0400
+++ to/aaa      2004-06-13 00:28:15.000000000 -0400
@@ -1 +1 @@
-111
+222

When I attempted to run patch, I got the following:

/home/guyr>patch -p1 <subdir.diff
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN from/aaa to/aaa
|--- from/aaa   2004-06-13 00:27:54.000000000 -0400
|+++ to/aaa     2004-06-13 00:28:15.000000000 -0400
--------------------------
File to patch:

I'm obviously missing something very fundamental.  Versions are:

diff (GNU diffutils) 2.8.4
patch 2.5.9
-- 
Guy Rouillier



reply via email to

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