This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlexperiment: document the private_use experiment
[perl5.git] / pod / perlgit.pod
index c34e709..2c7f5e8 100644 (file)
@@ -255,26 +255,32 @@ itself you can fix it up by editing the files once more and then issue:
 
   % git commit -a --amend
 
-Now you should create a patch file for all your local changes:
+Now, create a fork on GitHub to push your branch to, and add it as a
+remote if you haven't already, as described in the GitHub documentation
+at L<https://help.github.com/en/articles/working-with-forks>:
 
-  % git format-patch -M blead..
-  0001-Rename-Leon-Brocard-to-Orange-Brocard.patch
+  % git remote add fork git@github.com:MyUser/perl5.git
 
-Or for a lot of changes, e.g. from a topic branch:
+And push the branch to your fork:
 
-  % git format-patch --stdout -M blead.. > topic-branch-changes.patch
+  % git push -u fork orange
 
-You should now send an email 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
+You should now submit a Pull Request (PR) on GitHub from the new branch
+to blead. For more information, see the GitHub documentation at
+L<https://help.github.com/en/articles/creating-a-pull-request-from-a-fork>.
+
+You can also send patch files 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.
 
-Please do not use git-send-email(1) to send your patch. See L<Sending
-patch emails|/Sending patch emails> for more information.
+To create a patch file for all your local changes:
+
+  % git format-patch -M blead..
+  0001-Rename-Leon-Brocard-to-Orange-Brocard.patch
+
+Or for a lot of changes, e.g. from a topic branch:
+
+  % git format-patch --stdout -M blead.. > topic-branch-changes.patch
 
 If you want to delete your temporary branch, you may do so with:
 
@@ -285,30 +291,6 @@ If you want to delete your temporary branch, you may do so with:
  % git branch -D orange
  Deleted branch orange.
 
-=head2 Sending patch emails
-
-After you've generated your patch you should send it
-to L<perlbug@perl.org|mailto:perlbug@perl.org> (as discussed L<in the
-previous section|/"Patch workflow">) with a normal mail client as an
-attachment, along with a description of the patch.
-
-You B<must not> use git-send-email(1) to send patches generated with
-git-format-patch(1). The RT ticketing system living behind
-L<perlbug@perl.org|mailto:perlbug@perl.org> does not respect the inline
-contents of E-Mails, sending an inline patch to RT guarantees that your
-patch will be destroyed.
-
-Someone may download your patch from RT, which will result in the
-subject (the first line of the commit message) being omitted.  See
-L<RT #74192|https://rt.perl.org/Ticket/Display.html?id=74192> and
-L<commit a4583001|https://github.com/Perl/perl5/commit/a4583001>
-for an example. Alternatively someone may
-apply your patch from RT after it arrived in their mailbox, by which
-time RT will have modified the inline content of the message.  See
-L<RT #74532|https://rt.perl.org/Ticket/Display.html?id=74532> and
-L<commit f9bcfeac|https://github.com/Perl/perl5/commit/f9bcfeac>
-for a bad example of this failure mode.
-
 =head2 A note on derived files
 
 Be aware that many files in the distribution are derivative--avoid
@@ -574,6 +556,60 @@ to push your changes back with the C<camel> remote:
 The C<fetch> command just updates the C<camel> refs, as the objects
 themselves should have been fetched when pulling from C<origin>.
 
+=head2 Working with Github pull requests
+
+Pull requests typically originate from outside of the C<Perl/perl.git>
+repository, so if you want to test or work with it locally a vanilla
+C<git fetch> from the C<Perl/perl5.git> repository won't fetch it.
+
+However Github does provide a mechanism to fetch a pull request to a
+local branch.  They are available on Github remotes under C<pull/>, so
+you can use C<< git fetch pull/I<PRID>/head:I<localname> >> to make a
+local copy.  eg.  to fetch pull request 9999 to the local branch
+C<local-branch-name> run:
+
+  git fetch origin pull/9999/head:local-branch-name
+
+and then:
+
+  git checkout local-branch-name
+
+Note: this branch is not rebased on C<blead>, so instead of the
+checkout above, you might want:
+
+  git rebase origin/blead local-branch-name
+
+which rebases C<local-branch-name> on C<blead>, and checks it out.
+
+Alternatively you can configure the remote to fetch all pull requests
+as remote-tracking branches.  To do this edit the remote in
+F<.git/config>, for example if your github remote is C<origin> you'd
+have:
+
+  [remote "origin"]
+          url = git@github.com:/Perl/perl5.git
+          fetch = +refs/heads/*:refs/remotes/origin/*
+
+Add a line to map the remote pull request branches to remote-tracking
+branches:
+
+  [remote "origin"]
+          url = git@github.com:/Perl/perl5.git
+          fetch = +refs/heads/*:refs/remotes/origin/*
+          fetch = +refs/pull/*/head:refs/remotes/origin/pull/*
+
+and then do a fetch as normal:
+
+  git fetch origin
+
+This will create a remote-tracking branch for every pull request, including
+closed requests.
+
+To remove those remote-tracking branches, remove the line added above
+and prune:
+
+  git fetch -p origin # or git remote prune origin
+
 =head2 Accepting a patch
 
 If you have received a patch file generated using the above section,
@@ -788,7 +824,7 @@ seen on github.com it must be a local branch whose first name
 component is precisely C<smoke-me>.
 
 The procedure for doing this is roughly as follows (using the example of
-of tonyc's smoke-me branch called win32stat):
+tonyc's smoke-me branch called win32stat):
 
 First, make a local branch and switch to it: