Stacked PRs are now live on GitHub
GitHub has launched 'Stacked Pull Requests' in public preview, a feature designed to break down large changes into smaller, reviewable layers. This aims to streamline code reviews and accelerate feature delivery by allowing parallel reviews and single-click merging of entire stacks. The feature addresses a growing pain point, especially with the increasing size of changes, potentially from AI-assisted development.
The Lowdown
GitHub's new 'Stacked Pull Requests' feature, now in public preview, revolutionizes the way developers manage and review large code changes. Instead of monolithic PRs, this functionality allows for an ordered series of smaller, dependent pull requests, each representing a focused layer of the overall change. This structure enables independent review and parallel work, promising to significantly improve review efficiency and code quality.
Key aspects of Stacked PRs include:
- Accelerated Review Cycles: Teams can keep large projects moving by reviewing narrowly scoped PRs simultaneously.
- Enhanced Quality Control: Each layer can maintain quality through focused reviews, leveraging existing branch protections.
- Flexible Merging: Users can merge an entire stack with a single click or land individual layers, with subsequent PRs automatically rebasing and retargeting.
- Seamless Integration: It works out-of-the-box with existing GitHub features like checks and merge requirements.
- CLI Support: A dedicated
gh-stackCLI extension simplifies stack creation and management.
Rolling out progressively, this feature aims to tackle the challenges of complex codebases, with merge queue support also on the horizon. Developers are encouraged to explore the documentation and provide feedback to GitHub.
The Gossip
Excited Early Adopters
Many commenters express significant enthusiasm for GitHub's native stacked PRs, often citing prior positive experiences with similar tools like Graphite or the GitHub preview. They laud the feature for improving UX, simplifying the separation of large features into manageable components, and making the workflow much easier.
Glitches and Git Gripes
Despite the excitement, early preview users highlight several persistent issues. Concerns include broken 'merge entire stack' functionality, the need for re-approvals with squash merges, and the `gh stack rebase` tool struggling with out-of-sync local/remote branches. Some also question the fundamental benefit over carefully crafted atomic commits reviewed individually, suggesting it's more about improving a 'File > Save' commit style rather than a novel workflow.
AI's Implicit Influence
A prominent theme connects the timing and necessity of stacked PRs to the rise of AI-generated code. Several users hypothesize that the increasing size and complexity of AI-authored PRs create a strong need for tools to break them into human-reviewable chunks. One commenter, however, rejoiced at a new feature *not* directly related to AI, sparking a small debate.
Platform Pace and Competition
Commenters discuss GitHub's development velocity, with some noting its seemingly slow pace in adopting such features compared to other platforms or specialized tools like Jujutsu. There's an underlying sentiment that increased competition from companies like Linear, Vercel, and Zed might be spurring GitHub to innovate more aggressively. A common wish is for features like cross-repository stacking.