This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #82702] Fix commit message internal link.
[perl5.git] / pod / perlrepository.pod
index dcbb981..350b128 100644 (file)
@@ -1,3 +1,5 @@
+=encoding utf8
+
 =for comment
 Consistent formatting of this file is achieved with:
   perl ./Porting/podtidy pod/perlrepository.pod
@@ -64,8 +66,7 @@ directory.
 
 If you cloned using the git protocol, which is faster than ssh, then
 you will need to modify the URL for the origin remote to enable
-pushing. To do that edit F<.git/config> with L<git-config(1)> like
-this:
+pushing. To do that edit F<.git/config> with git-config(1) like this:
 
   % git config remote.origin.url ssh://perl5.git.perl.org/perl.git
 
@@ -224,22 +225,23 @@ not been pushed to the C<origin> remote yet. B<NOTE>: that this output
 is also what you see as a template if you do not provide a message to
 C<git commit>.
 
-Assuming that you'd like to commit all the changes you've just made as a
-a single atomic unit, run this command:
+Assuming that you'd like to commit all the changes you've just made as
+a single atomic unit, run this command:
 
    % git commit -a
 
 (That C<-a> tells git to add every file you've changed to this commit.
-New files aren't automatically added to your commit when you use C<commit
--a> If you want to add files or to commit some, but not all of your
-changes, have a look at the documentation for C<git add>.)
+New files aren't automatically added to your commit when you use
+C<commit -a> If you want to add files or to commit some, but not all of
+your changes, have a look at the documentation for C<git add>.)
 
 Git will start up your favorite text editor, so that you can craft a
 commit message for your change. See L</Commit message> below for more
 information about what makes a good commit message.
 
-Once you've finished writing your commit message and exited your editor,
-git will write your change to disk and tell you something like this:
+Once you've finished writing your commit message and exited your
+editor, git will write your change to disk and tell you something like
+this:
 
   Created commit daf8e63: explain git status and stuff about remotes
    1 files changed, 83 insertions(+), 3 deletions(-)
@@ -297,11 +299,10 @@ which is the short form of
 
 Creating a topic branch makes it easier for the maintainers to rebase
 or merge back into the master blead for a more linear history. If you
-don't work on a topic branch the maintainer has to manually cherry
-pick your changes onto blead before they can be applied.
+don't work on a topic branch the maintainer has to manually cherry pick
+your changes onto blead before they can be applied.
 
-That'll get you scolded on perl5-porters, so don't do that. Be
-Awesome.
+That'll get you scolded on perl5-porters, so don't do that. Be Awesome.
 
 Then make your changes. For example, if Leon Brocard changes his name
 to Orange Brocard, we should change his name in the AUTHORS file:
@@ -335,12 +336,69 @@ And you can see the changes:
    Lesley Binks                   <lesley.binks@gmail.com>
    Lincoln D. Stein               <lstein@cshl.org>
 
+For changes significant enough to warrant a F<pod/perldelta.pod> entry, the
+porters would greatly appreciate it if you submit an entry along with your
+actual change. Significant changes include, but are not limited to:
+
+=over 4
+
+=item *
+
+adding, deprecating, or removing core features
+
+=item *
+
+adding, deprecating, removing, or upgrading core or dual-life modules
+
+=item *
+
+adding new core tests
+
+=item *
+
+fixing security issues and user-visible bugs in the core
+
+=item *
+
+changes that might break existing code, either on the perl or C level
+
+=item *
+
+significant performance improvements
+
+=item *
+
+adding, removing, or significantly changing documentation in the F<pod/>
+directory
+
+=item *
+
+important platform-specific changes
+
+=back
+
+Please make sure you add the perldelta entry to the right section within
+F<pod/perldelta.pod>. More information on how to write good perldelta entries is
+available in the C<Style> section of F<Porting/how_to_write_a_perldelta.pod>.
+
 Now commit your change locally:
 
   % git commit -a -m 'Rename Leon Brocard to Orange Brocard'
   Created commit 6196c1d: Rename Leon Brocard to Orange Brocard
    1 files changed, 1 insertions(+), 1 deletions(-)
 
+The C<-a> option is used to include all files that git tracks that you have
+changed.  If at this time, you only want to commit some of the files you have
+worked on, you can omit the C<-a> and use the command C<S<git add I<FILE ...>>>
+before doing the commit.  C<S<git add --interactive>> allows you to even just
+commit portions of files instead of all the changes in them.
+
+The C<-m> option is used to specify the commit message.  If you omit it, git
+will open a text editor for you to compose the message interactively.  This
+is useful when the changes are more complex than the sample given here, and,
+depending on the editor, to know that the first line of the commit message
+doesn't exceed the 50 character legal maximum.
+
 You can examine your last commit with:
 
   % git show HEAD
@@ -352,13 +410,16 @@ itself you can fix it up by editing the files once more and then issue:
 
 Now you should create a patch file for all your local changes:
 
-  % git format-patch origin
+  % git format-patch -M origin..
   0001-Rename-Leon-Brocard-to-Orange-Brocard.patch
 
-You should now send an email to either perlbug@perl.org or
-perl5-porters@perl.org with a description of your changes, and include
-this patch file as an attachment. The perlbug address is preferred,
-but use perl5-porters for patches intended for discussion.
+You should now send an email to to
+L<perlbug@perl.org|mailto:perlbug@perl.org> with a description of your
+changes, and include this patch file as an attachment. In addition to
+being tracked by RT, mail to perlbug will automatically be forwarded to
+perl5-porters (with manual moderation, so please be patient). You should only
+send patches to L<perl5-porters@perl.org|mailto:perl5-porters@perl.org>
+directly if the patch is not ready to be applied, but intended for discussion.
 
 See the next section for how to configure and use git to send these
 emails for you.
@@ -406,31 +467,19 @@ Be aware that many files in the distribution are derivative--avoid
 patching them, because git won't see the changes to them, and the build
 process will overwrite them. Patch the originals instead.  Most
 utilities (like perldoc) are in this category, i.e. patch
-F<utils/perldoc.PL> rather than F<utils/perldoc>. Similarly, don't create
-patches for files under $src_root/ext from their copies found in
+F<utils/perldoc.PL> rather than F<utils/perldoc>. Similarly, don't
+create patches for files under $src_root/ext from their copies found in
 $install_root/lib.  If you are unsure about the proper location of a
 file that may have gotten copied while building the source
 distribution, consult the C<MANIFEST>.
 
-As a special case, several files are regenerated by 'make regen' if
-your patch alters C<embed.fnc>.  These are needed for compilation, but
-are included in the distribution so that you can build perl without
-needing another perl to generate the files.  You must test with these
-regenerated files, but it is preferred that you instead note that
-'make regen is needed' in both the email and the commit message, and
-submit your patch without them.  If you're submitting a series of
-patches, it might be best to submit the regenerated changes
-immediately after the source-changes that caused them, so as to have
-as little effect as possible on the bisectability of your patchset.
-
 =for XXX
-
 What should we recommend about binary files now? Do we need anything?
 
 =head2 Getting your patch accepted
 
-If you are submitting a code patch there are several things that
-you need to do.
+If you are submitting a code patch there are several things that you
+need to do.
 
 =over 4
 
@@ -440,8 +489,8 @@ As you craft each patch you intend to submit to the Perl core, it's
 important to write a good commit message.
 
 The first line of the commit message should be a short description and
-should skip the full stop. It should be no longer than the subject
-line of an E-Mail, 50 characters being a good rule of thumb.
+should skip the full stop. It should be no longer than the subject line
+of an E-Mail, 50 characters being a good rule of thumb.
 
 A lot of Git tools (Gitweb, GitHub, git log --pretty=oneline, ..) will
 only display the first line (cut off at 50 characters) when presenting
@@ -451,9 +500,9 @@ The commit message should include description of the problem that the
 patch corrects or new functionality that the patch adds.
 
 As a general rule of thumb, your commit message should let a programmer
-with a reasonable familiarity with the Perl core quickly understand what
-you were trying to do, how you were trying to do it and why the change
-matters to Perl.
+with a reasonable familiarity with the Perl core quickly understand
+what you were trying to do, how you were trying to do it and why the
+change matters to Perl.
 
 =over 4
 
@@ -526,10 +575,11 @@ sources:
 
 =item Testsuite
 
-If your patch changes code (rather than just changing documentation) you
-should also include one or more test cases which illustrate the bug you're
-fixing or validate the new functionality you're adding.  In general,
-you should update an existing test file rather than create a new one.
+If your patch changes code (rather than just changing documentation)
+you should also include one or more test cases which illustrate the bug
+you're fixing or validate the new functionality you're adding.  In
+general, you should update an existing test file rather than create a
+new one.
 
 Your testsuite additions should generally follow these guidelines
 (courtesy of Gurusamy Sarathy <gsar@activestate.com>):
@@ -649,8 +699,8 @@ C<git> provides a built-in way to determine, with a binary search in
 the history, which commit should be blamed for introducing a given bug.
 
 Suppose that we have a script F<~/testcase.pl> that exits with C<0>
-when some behaviour is correct, and with C<1> when it's faulty. You need
-an helper script that automates building C<perl> and running the
+when some behaviour is correct, and with C<1> when it's faulty. You
+need an helper script that automates building C<perl> and running the
 testcase:
 
   % cat ~/run
@@ -660,7 +710,7 @@ testcase:
   # If you get './makedepend: 1: Syntax error: Unterminated quoted
   # string' when bisecting versions of perl older than 5.9.5 this hack
   # will work around the bug in makedepend.SH which was fixed in
-  # version 96a8704c. Make sure to comment out `git co makedepend.SH'
+  # version 96a8704c. Make sure to comment out `git checkout makedepend.SH'
   # below too.
   git show blead:makedepend.SH > makedepend.SH
 
@@ -677,7 +727,7 @@ testcase:
   ./perl -Ilib ~/testcase.pl
   ret=$?
   [ $ret -gt 127 ] && ret=127
-  # git co makedepend.SH
+  # git checkout makedepend.SH
   git clean -dxf
   exit $ret
 
@@ -753,35 +803,35 @@ The same patch as above, using github might look like this:
   % git push origin orange
 
 The orange branch has been pushed to GitHub, so you should now send an
-email (see L</SUBMITTING A PATCH>) with a description of your changes
+email (see L</Submitting a patch>) with a description of your changes
 and the following information:
 
   http://github.com/USERNAME/perl/tree/orange
-  git@github.com:USERNAME/perl.git branch orange
+  git://github.com/USERNAME/perl.git branch orange
 
 =head1 Merging from a branch via GitHub
 
 If someone has provided a branch via GitHub and you are a committer,
 you should use the following in your perl-ssh directory:
 
-  % git remote add dandv git://github.com/dandv/perl.git
-  % git fetch dandv
+  % git remote add avar git://github.com/avar/perl.git
+  % git fetch avar
 
 Now you can see the differences between the branch and blead:
 
-  % git diff dandv/blead
+  % git diff avar/orange
 
 And you can see the commits:
 
-  % git log dandv/blead
+  % git log avar/orange
 
 If you approve of a specific commit, you can cherry pick it:
 
-  % git cherry-pick 3adac458cb1c1d41af47fc66e67b49c8dec2323f
+  % git cherry-pick 0c24b290ae02b2ab3304f51d5e11e85eb3659eae
 
 Or you could just merge the whole branch if you like it all:
 
-  % git merge dandv/blead
+  % git merge avar/orange
 
 And then push back to the repository:
 
@@ -865,9 +915,45 @@ deleted or modified. Think long and hard about whether you want to push
 a local tag to perl.git before doing so. (Pushing unannotated tags is
 not allowed.)
 
+=head1 Committing to blead
+
+If you are a committer, you have the right to commit changes directly to
+the 'blead' branch, which will become the next production release of Perl.
+
+Before pushing I<any> local change to blead, it's incredibly important
+that you do a few things, lest other committers come after you with
+pitchforks and torches:
+
+=over
+
+=item *
+
+Make sure you have a good commit message. See L</Commit message> elsewhere in
+this document
+
+=item *
+
+Run the test suite.  You might not think that one typo fix would break
+a test file. You'd be wrong.  Here's an example of where not running the
+suite caused problems.  A patch was submitted that added a couple of
+tests to an existing .t.  It couldn't possibly affect anything else, so
+no need to test beyond the single affected .t, right?  But, the
+submitter's email address had changed since the last of their
+submissions, and this caused other tests to fail.  Running the test
+target given in the next item would have caught this problem.
+
+=item *
+
+If you don't run the full test suite, at least C<make test_porting>.
+This will run basic sanity checks. To see which sanity checks, have a
+look in F<t/porting>.
+
+=back
+
 =head1 Committing to maintenance versions
 
-Maintenance versions should only be altered to add critical bug fixes.
+Maintenance versions should only be altered to add critical bug fixes,
+see L<perlpolicy>.
 
 To commit to a maintenance version of perl, you need to create a local
 tracking branch:
@@ -883,6 +969,9 @@ using the C<git cherry-pick> command. It is recommended to use the
 B<-x> option to C<git cherry-pick> in order to record the SHA1 of the
 original commit in the new commit message.
 
+Before pushing any change to a maint version, make sure you've satisfied
+the steps in L</Committing to blead> above.
+
 =head1 Grafts
 
 The perl history contains one mistake which was not caught in the
@@ -897,9 +986,18 @@ C<.git/info/grafts> file:
 It is particularly important to have this graft line if any bisecting
 is done in the area of the "merge" in question.
 
+=head1 SEE ALSO
 
+=over
 
-=head1 SEE ALSO
+=item *
+
+The git documentation, accessible via the C<git help> command
 
-The git documentation, accessible via C<git help command>.
+=item *
+
+L<perlpolicy> - Perl core development policy
+
+=back
 
+=cut