diff options
author | Dave Rolsky <autarch@urth.org> | 2011-02-05 13:12:28 -0600 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-02-05 14:20:13 -0800 |
commit | a126fb628b724353d161fad8da6c718f842f0a42 (patch) | |
tree | 9612f515b828795369b1439ff9ab92944045beb9 /pod/perlhack.pod | |
parent | 67bd0bf10c123b808e5598b91f5afa1c94696975 (diff) | |
download | perl-a126fb628b724353d161fad8da6c718f842f0a42.tar.gz |
Add a section on patch style (unified diff, etc) and how to generate patches
Based on a suggestion from H.Merijn Brand
Diffstat (limited to 'pod/perlhack.pod')
-rw-r--r-- | pod/perlhack.pod | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/pod/perlhack.pod b/pod/perlhack.pod index 5e32bc7f8f..9be39520a2 100644 --- a/pod/perlhack.pod +++ b/pod/perlhack.pod @@ -207,6 +207,35 @@ please explain why when you submit it. If you are submitting a code patch there are several things that you can do to help the Perl 5 Porters accept your patch. +=head3 Patch style + +If you used git to check out the Perl source, then using C<git +format-patch> will produce a patch in a style suitable for Perl. The +C<format-patch> command produces one patch file for each commit you +made. If you prefer to send a single patch for all commits, you can use +C<git diff>. + + % git co blead + % git pull + % git diff blead my-branch-name + +This produces a patch based on the difference between blead and your +current branch. It's important to make sure that blead is up to date +before producing the diff, that's why we call C<git pull> first. + +We strongly recommend that you use git if possible. It will make your +life easier, and ours as well. + +However, if you're not using git, you can still produce a suitable +patch. You'll need a pristine copy of the Perl source to diff against. +The porters prefer unified diffs. Using GNU C<diff>, you can produce a +diff like this: + + % diff -Npurd perl.pristine perl.mine + +Make sure that you C<make realclean> in your copy of Perl to remove any +build artifacts, or you may get a confusing result. + =head3 Commit message As you craft each patch you intend to submit to the Perl core, it's |