@@ -64,54 +64,8 @@ passes before merging any code changes.
6464Patch checklist
6565'''''''''''''''
6666
67- Along with running the tests, a simple automated patch checklist, ``patchcheck ``,
68- guides a developer through the common patch generation checks. To run
69- ``patchcheck ``:
70-
71- On *UNIX * (including Mac OS X)::
72-
73- make patchcheck
74-
75- On *Windows * (after any successful build)::
76-
77- python.bat Tools/scripts/patchcheck.py
78-
79- The automated patch checklist runs through:
80-
81- * Are there any whitespace problems in Python files?
82- (using ``Tools/scripts/reindent.py ``)
83- * Are there any whitespace problems in C files?
84- * Are there any whitespace problems in the documentation?
85- (using ``Tools/scripts/reindent-rst.py ``)
86- * Has the documentation been updated?
87- * Has the test suite been updated?
88- * Has an entry under ``Misc/NEWS.d/next `` been added?
89- * Has ``Misc/ACKS `` been updated?
90- * Has ``configure `` been regenerated, if necessary?
91- * Has ``pyconfig.h.in `` been regenerated, if necessary?
92-
93- The automated patch check doesn't actually *answer * all of these
94- questions. Aside from the whitespace checks, the tool is
95- a memory aid for the various elements that can go into
96- making a complete patch.
97-
98-
99- Commit Style
100- ------------
101-
102- .. move this to pullrequest
103-
104- Once a change patch is ready and tested, it can be committed to the repository.
105- We usually prefer to put a whole feature or bugfix into a single commit, but no
106- more. In particular:
107-
108- * Do **not ** fix more than one issue in the same commit (except, of course, if
109- one code change fixes all of them).
110- * Do **not ** do cosmetic changes to unrelated code in the same commit as some
111- feature/bugfix.
112-
113- It is of course okay to pile up several commits to one branch and merge them
114- into another in one commit.
67+ You should also :ref: `run patchcheck <patchcheck >` to perform a quick
68+ sanity check on the changes.
11569
11670
11771Handling Others' Code
@@ -245,39 +199,8 @@ allowed here because news entries are meant to be as readable as possible
245199unprocessed.)
246200
247201
248- Commit Messages
249- ---------------
250-
251- .. move to pullrequest
252-
253- Every commit has a commit message to document why a change was made and to
254- communicate that reason to other core developers. Python core developers have
255- developed a standard way of formatting commit messages that everyone is
256- expected to follow.
257-
258- Our usual convention mimics that used in news entries (it is actually common to
259- start by pasting the news entry into the commit message). The only key
260- difference when compared to a news entry is the inclusion of the issue number
261- as the beginning of the commit message. Here is an example::
262-
263- bpo-42: the spam module is now more spammy.
264-
265- The spam module sporadically came up short on spam. This change
266- raises the amount of spam in the module by making it more spammy.
267-
268- Thanks to Monty Python for the patch.
269-
270- The first line or sentence is meant to be a dense, to-the-point explanation
271- of what the purpose of the commit is. If this is not enough detail for a commit,
272- a new paragraph(s) can be added to explain in proper depth what has happened
273- (detail should be good enough that a core developer reading the commit message
274- understands the justification for the change). Also, if a non-core developer
275- contributed to the resolution, it is good practice to credit them.
276-
277-
278-
279202Working with Git _
280- =================
203+ -----------------
281204
282205.. seealso ::
283206 :ref: `gitbootcamp `
@@ -291,13 +214,17 @@ repositories means you have to be more careful with your workflow:
291214 dedicated to maintenance of the work before the work gets integrated in the
292215 main repository.
293216
217+ An exception to this rule: you can make a quick edit through the web UI of
218+ GitHub, in which case the branch you create can exist for less than 24 hours.
219+ This exception should not be abused and be left only for very simple changes.
220+
294221* You should not commit directly into the ``master `` branch, or any of the
295- maintenance branches (``2.7 ``, `` 3.5 ``, or ``3.6 ``). You should commit against
296- your own feature branch, and create a pull request.
222+ maintenance branches (currently ``2.7 `` or ``3.6 ``).
223+ You should commit against your own feature branch, and create a pull request.
297224
298- It is recommended to keep a fork of the main repository around, as it allows simple
299- reversion of all local changes (even "committed" ones) if your local clone gets
300- into a state you aren't happy with.
225+ It is recommended to keep a fork of the main repository around, as it allows
226+ simple reversion of all local changes (even "committed" ones) if your local
227+ clone gets into a state you aren't happy with.
301228
302229
303230.. _Git : https://git-scm.com/
@@ -306,7 +233,7 @@ into a state you aren't happy with.
306233.. _committing-active-branches :
307234
308235Active branches
309- ---------------
236+ '''''''''''''''
310237
311238If you do ``git branch `` you will see a :ref: `list of branches <listbranch >`.
312239``master `` is the in-development branch, and is the only branch that receives
@@ -316,17 +243,19 @@ new features. The other branches only receive bug fixes or security fixes.
316243.. _branch-merge :
317244
318245Backporting Changes to an Older Version
319- ---------------------------------------
246+ '''''''''''''''''''''''''''''''''''''''
320247
321- When it is determined that a pull request needs to be backported into one or more of
322- the maintenance branches, a core developer can apply the labels `` needs backport to X.Y ``
323- to the pull request.
248+ When it is determined that a pull request needs to be backported into one or
249+ more of the maintenance branches, a core developer can apply the labels
250+ `` needs backport to X.Y `` to the pull request.
324251
325- After the pull request has been merged, it can be backported using cherry_picker.py _.
252+ After the pull request has been merged, it can be backported using
253+ cherry_picker.py _.
326254
327- The commit hash can be obtained from the original pull request, or by using `git log `
328- on the ``master `` branch. To display the 10 most recent commit hashes and their first
329- line of the commit message::
255+ The commit hash can be obtained from the original pull request, or by using
256+ ``git log `` on the ``master `` branch.
257+ To display the 10 most recent commit hashes and their first line of the commit
258+ message::
330259
331260 git log -10 --oneline
332261
@@ -344,7 +273,7 @@ Developers can apply labels to GitHub pull requests).
344273
345274
346275Reverting a Merged Pull Request
347- -------------------------------
276+ '''''''''''''''''''''''''''''''
348277
349278To revert a merged pull request, press the ``Revert `` button at the bottom of
350279the pull request. It will bring up the page to create a new pull request where
0 commit comments