Chapter 2 · Practice 2 of 4
Keep pull requests small and focused
Why it matters
Reviewers give careful feedback on a 150 line change and skim a 1,500 line one. Small pull requests get reviewed faster, catch more bugs and are easier to revert.
If a feature is large, split it into a series of pull requests that each make sense alone:
- The data model
- Then the API
- Then the UI
Keep refactors and renames in their own pull request so the real change is not buried.
If you cannot avoid a big pull request, guide the reviewer with a description of where to start.
Do
- Aim for a pull request a reviewer can read in one sitting
- Put pure renames and moves in a separate pull request