Skip to content

Commit 617d9ec

Browse files
Grinnzkhwilliamson
authored andcommitted
Update perlgit and perlhack to reference GitHub pull request workflow
1 parent b0df1b4 commit 617d9ec

File tree

2 files changed

+48
-72
lines changed

2 files changed

+48
-72
lines changed

pod/perlgit.pod

+19-37
Original file line numberDiff line numberDiff line change
@@ -255,26 +255,32 @@ itself you can fix it up by editing the files once more and then issue:
255255

256256
% git commit -a --amend
257257

258-
Now you should create a patch file for all your local changes:
258+
Now, create a fork on GitHub to push your branch to, and add it as a
259+
remote if you haven't already, as described in the GitHub documentation
260+
at L<https://help.github.com/en/articles/working-with-forks>:
259261

260-
% git format-patch -M blead..
261-
0001-Rename-Leon-Brocard-to-Orange-Brocard.patch
262+
% git remote add fork [email protected]:MyUser/perl5.git
262263

263-
Or for a lot of changes, e.g. from a topic branch:
264+
And push the branch to your fork:
264265

265-
% git format-patch --stdout -M blead.. > topic-branch-changes.patch
266+
% git push -u fork orange
266267

267-
You should now send an email to
268-
L<[email protected]|mailto:[email protected]> with a description of your
269-
changes, and include this patch file as an attachment. In addition to
270-
being tracked by RT, mail to perlbug will automatically be forwarded to
271-
perl5-porters (with manual moderation, so please be patient). You
272-
should only send patches to
268+
You should now submit a Pull Request (PR) on GitHub from the new branch
269+
to blead. For more information, see the GitHub documentation at
270+
L<https://help.github.com/en/articles/creating-a-pull-request-from-a-fork>.
271+
272+
You can also send patch files to
273273
L<[email protected]|mailto:[email protected]> directly if the
274274
patch is not ready to be applied, but intended for discussion.
275275

276-
Please do not use git-send-email(1) to send your patch. See L<Sending
277-
patch emails|/Sending patch emails> for more information.
276+
To create a patch file for all your local changes:
277+
278+
% git format-patch -M blead..
279+
0001-Rename-Leon-Brocard-to-Orange-Brocard.patch
280+
281+
Or for a lot of changes, e.g. from a topic branch:
282+
283+
% git format-patch --stdout -M blead.. > topic-branch-changes.patch
278284

279285
If you want to delete your temporary branch, you may do so with:
280286

@@ -285,30 +291,6 @@ If you want to delete your temporary branch, you may do so with:
285291
% git branch -D orange
286292
Deleted branch orange.
287293

288-
=head2 Sending patch emails
289-
290-
After you've generated your patch you should send it
291-
to L<[email protected]|mailto:[email protected]> (as discussed L<in the
292-
previous section|/"Patch workflow">) with a normal mail client as an
293-
attachment, along with a description of the patch.
294-
295-
You B<must not> use git-send-email(1) to send patches generated with
296-
git-format-patch(1). The RT ticketing system living behind
297-
L<[email protected]|mailto:[email protected]> does not respect the inline
298-
contents of E-Mails, sending an inline patch to RT guarantees that your
299-
patch will be destroyed.
300-
301-
Someone may download your patch from RT, which will result in the
302-
subject (the first line of the commit message) being omitted. See
303-
L<RT #74192|https://rt.perl.org/Ticket/Display.html?id=74192> and
304-
L<commit a4583001|https://github.com/Perl/perl5/commit/a4583001>
305-
for an example. Alternatively someone may
306-
apply your patch from RT after it arrived in their mailbox, by which
307-
time RT will have modified the inline content of the message. See
308-
L<RT #74532|https://rt.perl.org/Ticket/Display.html?id=74532> and
309-
L<commit f9bcfeac|https://github.com/Perl/perl5/commit/f9bcfeac>
310-
for a bad example of this failure mode.
311-
312294
=head2 A note on derived files
313295

314296
Be aware that many files in the distribution are derivative--avoid

pod/perlhack.pod

+29-35
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ perlhack - How to hack on Perl
1111
=head1 DESCRIPTION
1212

1313
This document explains how Perl development works. It includes details
14-
about the Perl 5 Porters email list, the Perl repository, the Perlbug
14+
about the Perl 5 Porters email list, the Perl repository, the Perl
1515
bug tracker, patch guidelines, and commentary on Perl development
1616
philosophy.
1717

@@ -36,6 +36,13 @@ latest version directly from the perl source:
3636

3737
% perldoc pod/perlhack.pod
3838

39+
=item * Create a branch for your change
40+
41+
Create a branch based on blead to commit your change to, which will
42+
later be used to send it to the Perl issue tracker.
43+
44+
% git checkout -b mychange
45+
3946
=item * Make your change
4047

4148
Hack, hack, hack. Keep in mind that Perl runs on many different
@@ -61,29 +68,23 @@ Committing your work will save the change I<on your local system>:
6168
Make sure the commit message describes your change in a single
6269
sentence. For example, "Fixed spelling errors in perlhack.pod".
6370

64-
=item * Send your change to perlbug
71+
=item * Send your change to the Perl issue tracker
6572

66-
The next step is to submit your patch to the Perl core ticket system
67-
via email.
73+
The next step is to submit your patch to the Perl core ticket system.
6874

69-
If your changes are in a single git commit, run the following commands
70-
to generate the patch file and attach it to your bug report:
75+
Create a GitHub fork of the perl5 repository and add it as a remote,
76+
if you haven't already, as described in the GitHub documentation at
77+
L<https://help.github.com/en/articles/working-with-forks>.
7178

72-
% git format-patch -1
73-
% ./perl -Ilib utils/perlbug -p 0001-*.patch
79+
% git remote add fork [email protected]:MyUser/perl5.git
7480

75-
The perlbug program will ask you a few questions about your email
76-
address and the patch you're submitting. Once you've answered them it
77-
will submit your patch via email.
81+
Then, push your new branch to your fork.
7882

79-
If your changes are in multiple commits, generate a patch file for each
80-
one and provide them to perlbug's C<-p> option separated by commas:
83+
% git push -u fork mychange
8184

82-
% git format-patch -3
83-
% ./perl -Ilib utils/perlbug -p 0001-fix1.patch,0002-fix2.patch,\
84-
> 0003-fix3.patch
85-
86-
When prompted, pick a subject that summarizes your changes.
85+
Finally, create a Pull Request on GitHub from your branch to blead as
86+
described in the GitHub documentation at
87+
L<https://help.github.com/en/articles/creating-a-pull-request-from-a-fork>.
8788

8889
=item * Thank you
8990

@@ -107,6 +108,7 @@ latest perl in a pristine state. Check you don't have any local changes
107108
or added files in your perl check-out which you wish to keep, then run
108109
these commands:
109110

111+
% git checkout blead
110112
% git pull
111113
% git reset --hard origin/blead
112114
% git clean -dxf
@@ -218,27 +220,15 @@ Perl source.
218220

219221
=head2 Submitting patches
220222

221-
If you have a small patch to submit, please submit it via perlbug. You
222-
can also send email directly to [email protected]. Please note that
223-
messages sent to perlbug may be held in a moderation queue, so you
224-
won't receive a response immediately.
223+
If you have a small patch to submit, please submit it via the GitHub
224+
Pull Request workflow. You may also send patches to the p5p list.
225225

226-
You'll know your submission has been processed when you receive an
227-
email from our ticket tracking system. This email will give you a
228-
ticket number. Once your patch has made it to the ticket tracking
229-
system, it will also be sent to the [email protected] list.
230-
231-
If your patch is related to an already-opened ticket you can also
232-
attach your patch to that ticket, without having to use perlbug.
233-
234-
Patches are reviewed and discussed on the p5p list. Simple,
226+
Patches are reviewed and discussed on GitHub or the p5p list. Simple,
235227
uncontroversial patches will usually be applied without any discussion.
236228
When the patch is applied, the ticket will be updated and you will
237-
receive email. In addition, an email will be sent to the p5p list.
238-
239-
In other cases, the patch will need more work or discussion. That will
240-
happen on the p5p list.
229+
receive email.
241230

231+
In other cases, the patch will need more work or discussion.
242232
You are encouraged to participate in the discussion and advocate for
243233
your patch. Sometimes your patch may get lost in the shuffle. It's
244234
appropriate to send a reminder email to p5p if no action has been taken
@@ -258,6 +248,10 @@ can do to help the Perl 5 Porters accept your patch.
258248

259249
=head3 Patch style
260250

251+
Using the GitHub Pull Request workflow, your patch will automatically
252+
be available in a suitable format. If you wish to submit a patch to
253+
the p5p list for review, make sure to create it appropriately.
254+
261255
If you used git to check out the Perl source, then using C<git
262256
format-patch> will produce a patch in a style suitable for Perl. The
263257
C<format-patch> command produces one patch file for each commit you

0 commit comments

Comments
 (0)