AI summary by TwinMind
Big Pull Requests
Theo - t3․gg
13m 53s
Code Review Problems and Impact
- Code review consumes 50%+ of developer time for many devs
- Feature branch hell: thousands of lines PRs nobody wants to review
- Nitpick cycles requiring re-approval from 15+ teams
- Work gets stuck for months in these workflows
- Big PRs are biggest blocker to software development velocity
Change Amplification and Complexity
- Fundamental challenge: managing/minimizing complexity in software engineering
- Change amplification: simple changes require modifications across many files/functions
- Early web development example: banner color change required updates to every page
- Modern practices centralize elements to reduce widespread code changes
- Well-architected systems limit code affected by each design decision
- High amplification changes signal problematic coupling levels
Data Analysis: PR Size Impact on Merge Times
- Graphite analyzed 1.5 million PRs from top engineers
- Median time to merge increases dramatically with file count
- Fastest PRs change fewest files
- Even slight increase in file count can double merge time
- Higher file counts indicate:
- Higher risk coupled code
- Greater likelihood of CI failures
- Increased review complexity
- More cognitive effort for reviewers
- Higher chance of rebase conflicts (Git operates per-file level)
Multi-Team Ownership Complications
- Multiple teams owning different codebase parts creates approval bottlenecks
- Workflow: Team A approves → Team B requests changes → affects Team A's files → requires re-approval from all teams
- Creates cascading approval cycles
Review Efficiency Paradox
- Time to review per file decreases as PR size grows beyond moderate complexity
- "10 lines of code = 10 issues, 500 lines of code = looks fine"
- Large PRs get superficial review vs thorough line-by-line assessment
- Reviewers shift to broader risk-oriented evaluation for large PRs
- Cognitive limits cause reviewers to lose focus across many files
- Auto-generated/repetitive changes quick to verify once pattern identified
Best Practices Recommendation
- Limit to 3 or fewer files changed per PR
- Small PRs lead to faster merges and higher quality reviews
- Large PRs get less concentrated reviewer focus
Stacking Workflow Solution
- Alternative to traditional PR-on-PR approach
- Creates individual small PRs that can be improved piece by piece
- Flattens all changes at once when ready
- Stack = somewhere between commit and pull request
- Developer controls when to create new stack
- Ideal: keep stacks small (3 files or less)
- Choose when to break up work for reviewability/understandability
Stacking Benefits
- Parallelizes development and code review workflows
- No waiting for previous changes to merge before building on top
- Eliminates merge conflict hell from traditional workflows
- Example workflow: server endpoint PR + dependent frontend PR
- Frontend approved, backend requests changes → can fix backend without breaking frontend approval
- Both merge together once both approved
Code-First vs Branch-First Development
- Traditional Git: branch first, code second
- Stack diffs: code first, commit second
- Developer feels more empowered to decide when to break up work
- Avoids Git workflow pain points like branch naming issues
Technical Implementation Challenges
- Manual stacking difficult due to PR dependencies
- Upstream changes require recursive rebasing of entire stack
- Git CLI not designed for this workflow
- Individual branch rebasing time-consuming
- Cascading merge conflicts particularly problematic
Tooling Solutions
- Graphite (sponsors channel) - primary recommendation
- Open source alternatives: GH stack, Git Town, Sapling
- Git adding more stacking support with update-refs option
- Still requires dealing with GitHub PR management tedium
Industry Adoption
- Google and Meta use stacking workflows extensively
- Maintains velocity at scale
- Enables fast movement without sacrificing quality
- Small PRs are more correct, easier to review, faster to merge, better for debugging
Quality Impact Theory
- Modern software bugginess potentially linked to massive PRs barely reviewed
- Teams merging large changes without thorough review
- Stacking forces better code structure and understanding
