From: Andreas König Date: Sun, 11 Feb 2001 16:46:28 +0000 (+0100) Subject: Document makepatch in Porting/patching X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=39f9fc433ed605c97e9ab03ac9e6d33f58f82877;p=p5sagit%2Fp5-mst-13.2.git Document makepatch in Porting/patching Message-ID: p4raw-id: //depot/perl@8767 --- diff --git a/Porting/patching.pod b/Porting/patching.pod index 5659f23..7fd376b 100644 --- a/Porting/patching.pod +++ b/Porting/patching.pod @@ -94,12 +94,7 @@ diffs. Some examples using GNU diff: # show function name in every hunk (safer, more informative) % diff -u -F '^[_a-zA-Z0-9]+ *(' old/file new/file - -=item Directories - -IMPORTANT: Patches should be generated from the source root directory, not -from the directory that the patched file resides in. This ensures that the -maintainer patches the proper file. +=item Derived Files Many files in the distribution are derivative--avoid patching them. Patch the originals instead. Most utilities (like perldoc) are in @@ -120,6 +115,31 @@ If you are submitting patches that affect multiple files then you should backup the entire directory tree (to $source_root.old/ for example). This will allow C to create all the patches at once. +=item Directories + +IMPORTANT: Patches should be generated from the source root directory, not +from the directory that the patched file resides in. This ensures that the +maintainer patches the proper file. + +For larger patches that are dealing with multiple files or +directories, Johan Vromans has written a powerful utility: makepatch. +See the JV directory on CPAN for the current version. If you have this +program available, it is recommended to create a duplicate of the perl +directory tree against which you are intending to provide a patch and +let makepatch figure out all the changes you made to your copy of the +sources. As perl comes with a MANIFEST file, you need not delete +object files and other derivative files from the two directory trees, +makepatch is smart about them. + +Say, you have created a directory perl-5.7.1@8685/ for the perl you +are taking as the base and a directory perl-5.7.1@8685-withfoo/ where +you have your changes, you would run makepatch as follows: + + makepatch -oldman perl-5.7.1@8685/MANIFEST \ + -newman perl-5.7.1@8685-withfoo/MANIFEST \ + -diff "diff -u" \ + perl-5.7.1@8685 perl-5.7.1@8685-withfoo + =item Try it yourself Just to make sure your patch "works", be sure to apply it to the Perl