John Roest

The Case for Small Pull Requests: Lessons Learned from a Big Mistake

Mon Aug 19 2024

The Case for Small Pull Requests: Lessons Learned from a Big Mistake

As developers, we often hear the advice to keep our pull requests (PRs) small and focused. But if you're anything like me, you've probably found yourself—at least once—submitting a mammoth PR that seemed to solve all the problems in one go. I did it, and it was a learning experience that I won't forget anytime soon.

The Big Pull Request: What Went Wrong

It all started when I embarked on a sizable feature update. The changes spanned multiple files, touched several parts of the codebase, and included a mix of refactoring, bug fixes, and new functionality. At the time, I thought I was being efficient—why submit multiple PRs when I could wrap everything into one?

When I finally hit "Create Pull Request," I felt a mix of relief and accomplishment. That feeling didn’t last long.

The First Sign of Trouble: Feedback Overload

As my colleagues began to review the PR, the comments started rolling in—dozens upon dozens of them. Some pointed out issues I had overlooked; others requested changes or asked for clarifications on why I had made certain decisions.

It quickly became clear that my PR was overwhelming for the reviewers. They had to dig through a mountain of code to understand the full scope of the changes, making it difficult to provide meaningful feedback. Each round of review felt like an uphill battle for everyone involved.

The Second Sign: Wasted Time and Energy

The time it took to get the PR reviewed and approved was significantly longer than I anticipated. Since the PR was so large, some colleagues had to revisit it multiple times, and every change I made in response to feedback required them to re-review sections they had already looked at. This wasn’t just a waste of their time—it also delayed the feature from being merged into the main branch.

The Lesson: Small Pull Requests Are the Way Forward

After that experience, I changed my approach. I realized that the efficiency I thought I was gaining by bundling everything into one PR was an illusion. In reality, it created more work for everyone.

Why Small PRs Work Better

  • Better Readability: When a PR is small, it's easier for reviewers to understand the context and purpose of the changes. They can focus on the specific issue at hand without getting distracted by unrelated changes.

  • Faster Feedback: Smaller PRs are quicker to review, which means you get feedback faster. This leads to a faster approval process and quicker integration into the main branch.

  • Easier to Test and Merge: With fewer changes to consider, testing becomes more straightforward. Smaller PRs reduce the risk of introducing bugs because it's easier to isolate the effects of the changes.

  • Less Disruption: If something goes wrong, it's easier to revert a small PR than a large one. This minimizes the impact on the codebase and on the team’s productivity.

Aligning with Trunk-Based Development

Trunk-based development, a version control strategy where developers merge small, frequent updates into the main branch, emphasizes exactly this approach. By keeping PRs small and focused, we align our work with this strategy, which leads to more stable releases and a smoother development process overall.

Moving Forward

Since that painful experience, I've committed to submitting smaller, more focused PRs. Not only has this improved the quality of the reviews I receive, but it has also fostered a more collaborative environment within the team. We're all able to move faster, with fewer bottlenecks and less frustration.

If you're still on the fence about whether small PRs are worth the effort, take it from me—it's a lesson best learned sooner rather than later. Your future self (and your teammates) will thank you.


Have you ever submitted a giant PR? How did it go? I’d love to hear about your experiences and any tips you’ve picked up along the way.