From: Gurusamy Sarathy Date: Tue, 9 Jun 1998 00:59:06 +0000 (+0000) Subject: [win32] add examples of diff(1) usage X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9e52009c4fe79f4b4fa8cc2d466a768202f67e38;p=p5sagit%2Fp5-mst-13.2.git [win32] add examples of diff(1) usage p4raw-id: //depot/win32/perl@1079 --- diff --git a/Porting/patching.pod b/Porting/patching.pod index b528ad7..e3b6188 100644 --- a/Porting/patching.pod +++ b/Porting/patching.pod @@ -67,6 +67,25 @@ Also, if your patch is to the core (rather than to a module) it is better to create it as a context diff as some machines have broken patch utilities that choke on unified diffs. +GNU diff has many desirable features not provided by most vendor-supplied +diffs. Some examples using GNU diff: + + # generate a patch for a newly added file + % diff -u /dev/null new/file + + # generate a patch to remove a file (patch > v2.4 will remove it cleanly) + % diff -u old/goner /dev/null + + # get additions, deletions along with everything else, recursively + % diff -ruN olddir newdir + + # ignore whitespace + % diff -bu a/file b/file + + # show function name in every hunk (safer, more informative) + % diff -u -F '^[_a-zA-Z0-9]+ *(' old/file new/file + + =item Directories Patches should be generated from the source root directory, not from the