[Top][All Lists]

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

Re: diff/patch with subdirectories

From: Michael Elizabeth Chastain
Subject: Re: diff/patch with subdirectories
Date: Tue, 29 Jun 2004 15:04:37 -0400 (EDT)

Hi Guy,

(It's been a few years since I worked on the kernel so this might
 be out of date).

I think you are running 'diff' just fine, although I like to add
some more flags:

  diff -u -r -N from/ to/ > my.patch

The gotcha is when you run 'patch'.  You don't want to patch the
'to' directory; it's already got the new content.  When you apply
the patch, you want to do this:

  cd from/
  patch -p1 < my.patch

If I recall correctly, it's taken for granted that anyone applying a
patch can figure out the right p-level (usually -p0 or -p1).

Other people won't get confused when they get your patch because
they have a 'from' directory ('abc') but not a 'to' directory ('def').
They don't have the 'def' contents until after they apply your patch!

Hope this helps,

Michael C

reply via email to

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