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

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

Re: How create and apply a patch in one directory ??


From: Stepan Kasal
Subject: Re: How create and apply a patch in one directory ??
Date: Tue, 24 Jun 2003 10:33:52 +0200
User-agent: Mutt/1.2.5.1i

Hello,

On Mon, Jun 23, 2003 at 05:56:25PM -0300, andre duarte bueno wrote:
> Sorry if appears as a base question, but all book about linux 
> programming not cover patch
> in a directory, only on an individual file.

try to search an internet.  Or try a help list, this list is for
bug reports only.

Anyway:

> 5) I create a diff file using
> cd /tmp
> diff  teste teste-r2 > patch_file

The common way to create patches is ``diff -urpN''.
You have to use -u or -c to get a reasonable format.
You have to use either -r or compare individual files, like

diff -u teste{,-r2}/List-17-1-Polimorfismo.cpp >teste2.patch

(your book should explain you the braces)

The reason is that lines like this:
> |Common subdirectories: teste/CVS and teste-r2/CVS
should not appear in teh patch.

> 6) I use
> cd /tmp
> patch -p0 < patch_file

It's much safer to use

cd /tmp/teste
patch -p1 <teste2.patch

HTH (hope this helps),
        Stepan Kasal




reply via email to

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