delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/18/09:17:34

Date: Tue, 18 Aug 1998 16:17:22 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Gurunandan R. Bhat" <grbhat AT unigoa DOT ernet DOT in>
cc: djgpp AT delorie DOT com
Subject: Re: Canonical way to obtain diffs
In-Reply-To: <Pine.LNX.3.91.980816161403.2903A-100000@aditya.unigoa.ernet.in>
Message-ID: <Pine.SUN.3.91.980818160942.12510f-100000@is>
MIME-Version: 1.0

On Sun, 16 Aug 1998, Gurunandan R. Bhat wrote:

> 	What command line options must I give to diff if I am to submit
> patches to programs in the djgpp distribution? 

	diff -c old new > patch-file

Please invoke this command from the root of your DJGPP installation, and 
have `old' and `new' in the above example be given with their full 
pathname relative to that root, and with *forward* slashes.  For example:

   diff -c src/debug/common/syms.old src/debug/common/sysms.c > syms.pat

Do NOT use any switches to `diff' that cause it ignore whitespace (the 
resulting patch will not apply without human intervention).

It is also a good idea to run your patch file through DTOU before mailing 
it (unless your mailer is smart enough to convert the DOS-style CR-LF 
pairs for you).  That's because DJ Delorie applies the patches on a Unix 
box, where `patch' doesn't necessarily understand DOS-style EOLs.

> And conversely, how should patch be used to obtain newfile from distfile. 

	patch -p0 -b < patch-file

Again, this should be run from the root of the DJGPP installation.

Please note that the above is NOT the only way that you can generate 
diffs and apply them.  There are numerous other ways, each one of which 
will work under some circumstances.  But by sticking to the above 
paradigm, you make sure that your patches will *always* work.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019