[H-GEN] using patch
Edwin Groothuis
edwin at mavetju.org
Fri Mar 14 23:51:53 EST 2003
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]
On Sat, Mar 15, 2003 at 10:00:29AM +1000, barry day wrote:
> What's the go with using patch to apply diff files?
> I've yet to get one to work. Is it me or is creating
> diff files that will work with patch a black art?
Yes, patches are black art.
They only work with sources which are the same as the original code.
They only work if you haven't changed a single line. They only work
under these special conditions. If these don't exist, you will run
into problems. The most harmless of them is that you get "offset
by n lines", the most horrible is that half of the patches can be
applied and the other half can't.
Patches have evolved in the past, from "delete this linenumber" and
"add this line at this linenumber" (normal diff) to more fail-proof
ones which give the context like "somewhere at this line you will
find these characters, add and remove these these lines in there"
(unified diff).
If you make patches, diff them with the -u option so that you have
the context around it which might (will) save you lots of troubles.
Not that this all will help you, it's just something I've learned
and taught[sp] in the past couple of years on several mailing-lists.
Edwin
--
Edwin Groothuis | Personal website: http://www.mavetju.org
edwin at mavetju.org | Weblog: http://www.mavetju.org/weblog/weblog.php
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'. See http://www.humbug.org.au/
More information about the General
mailing list