Skip to content
← All articles
Workflow3 min read

How to split a pull request without losing the story

Keep changes easy to understand by separating mechanical work, behavior changes, and rollout decisions into reviewable steps.

By AntiCode Editorial·

Give the reviewer one decision

A pull request should make it possible to state the decision being reviewed in a sentence. Approve a new validation rule. Replace a deprecated client. Introduce a compatibility layer. When a change asks reviewers to accept all three at once, they must hold several explanations in their heads while checking the code.

GitHub recommends focused pull requests with enough context to explain their purpose. Google's engineering guidance makes a related point: a small change should form a coherent unit. The useful target is not an arbitrary number of lines. It is a change that can be understood, tested, and discussed without unrelated decisions obscuring the important one.

Separate mechanical changes from behavior

Suppose a feature renames an input type, moves a parser, and changes how empty values are handled. A reviewer looking at a large diff must distinguish relocation from the actual behavior change. Put the rename or movement in a preparatory change when it can stand alone. Then make the semantic change against the clearer structure.

Do not split code simply to make a counter smaller. Moving half a required validation rule into a later pull request can leave the intermediate state unsafe. Every step should preserve the invariants your production system requires. If that cannot be achieved, keep the coupled change together and explain why.

Make dependencies visible

A sequence of small pull requests needs a readable order. Give each description a brief statement of what it assumes and what the next step will enable. If a later change depends on an earlier one, link that dependency and identify which tests establish the intermediate behavior.

For a schema transition, an example sequence might add a compatible reader, introduce writes in the new format, and remove old support only after the transition is verified. This is an illustration, not a universal migration recipe. The correct boundaries depend on deployment order, rollback requirements, and how long old clients can remain active.

  • Describe the user-visible behavior changed by this step.
  • List dependencies that must land first.
  • State the evidence that the intermediate state remains usable.
  • Explain what is deliberately deferred and where it will be tracked.

Write a description that survives the conversation

A useful description gives future readers the reason for the change. Include the concrete failure or need, the resulting behavior, and the validation that matters. If most of the diff is generated, say where the meaningful source change lives. If a deletion is intentional, explain the replacement or why the behavior is no longer needed.

Self-review before requesting attention. Read the final diff, look for accidental formatting churn, and confirm that the tests describe the submitted version. A reviewer should not have to reconstruct the intended patch from your editor history. Screenshots can help with a visible interface change, but they do not replace an explanation of interaction behavior.

Use review limits as a planning signal

AntiCode reviews the selected pull-request diff and rejects diffs larger than its supported review budget instead of presenting a partial analysis as a clean result. If a change exceeds that boundary, reconsider its structure or use another appropriate review method. Do not remove important context just to squeeze under a limit.

Small pull requests still need thoughtful review. A one-line authorization change can deserve more attention than a large generated update. Organize around the number of meaningful decisions and the risk of the behavior, then give both human and AI reviewers a complete, focused question to answer.

Further reading

Put it into practice

Start with a small change you are authorized to review. Follow the AntiCode setup guide, inspect each finding, and keep your tests and human approval in the loop.

Keep reading.

All field notes ↗