GitHub revives Phabricator's stacked diffs with new Stacked PRs preview
#Regulation

GitHub revives Phabricator's stacked diffs with new Stacked PRs preview

Regulation Reporter
3 min read

GitHub has unveiled Stacked PRs, a private preview feature that lets developers break large code changes into smaller, independently reviewable chunks by stacking pull requests. The approach, familiar from Facebook's Phabricator, aims to speed up code reviews and merge workflows.

GitHub has unveiled Stacked PRs, a new feature aimed at making large pull requests easier to review, manage, and move through the pipeline faster. Stacked PRs, now in private preview, enable a pull request to be based on a previous pull request to form a stack. Each pull request in the stack can be reviewed and merged independently, provided that all the pull requests below it in the stack are merged first. It is also possible to merge the whole stack together.

Managing stacked PRs in GitHub

There are several benefits to Stacked PRs, the most obvious being that they encourage smaller pull requests, which are therefore easier to review. "Each branch in a stack should represent a discrete, logical unit of work that can be reviewed independently," the docs explain. This is normally hard to achieve because developers typically want to continue working on code, even where the new code depends on earlier code that is not yet merged with the main branch. Waiting for each small piece to be reviewed and merged would cause too much delay, so instead they continue working in a separate branch until a feature is complete. The consequence is a large pull request with code changes in many files, which are hard to review.

The Stacked PRs feature is new to GitHub, but familiar from other code management and review systems, where it is often called stacked diffs. One well-known example was Differential, created by Facebook's Evan Priestley and Luke Shepard in 2007. "I was spending a lot of time waiting for code review to happen, which was a major motivator for building the tool," said Priestley. Differential became part of a suite of tools used by Facebook, called Phabricator, and was released as open source in 2011. Open source Phabricator ceased development in 2021, though a fork called Phorge remains actively maintained.

The developer workflow when using Stacked PRs is substantially different from that used without them. The bottom PR in a stack is normally based on the main branch, rather than a separate branch. Jackson Gabbard, who was an engineer at Facebook between 2006 and 2016, wrote a detailed explainer in which he said "people who have worked with Phabricator using a 'stacked diff' workflow generally love it and seek it wherever they next go."

A discussion of the feature on Hacker News is generally positive, though a developer observed: "I don't quite see the need for this CLI [command line interface]. Git has had some additions in the last few years that make this work natively." The CLI referenced here is the new GitHub-specific extension gh stack. Nevertheless, building this into GitHub is a major change, and the CLI simplifies its use. GitHub's Sameen Karim, who has been working on the feature, said that "the CLI is completely optional, you can create stacked PRs purely via the UI."

GitHub also has AI in mind. "The bottleneck is no longer writing code – it's reviewing it. Stacks help solve that," said Karim on LinkedIn. The stack CLI is also designed for use by AI agents, Karim said.

This revival of Phabricator's stacked diff workflow represents GitHub's recognition that as AI coding tools accelerate code production, the review process has become the critical bottleneck. By making it easier to break down complex changes into reviewable chunks, GitHub aims to keep development velocity high even as code review demands increase.

For teams already familiar with stacked diffs from Phabricator or other systems, GitHub's implementation brings this proven workflow into the mainstream. For those new to the concept, it offers a structured way to manage complex feature development without overwhelming reviewers with massive pull requests.

The private preview status suggests GitHub is still refining the feature based on early feedback, but the company's commitment to making it work with both the web UI and CLI indicates they see stacked PRs as a core part of their platform's future development workflow.

Comments

Loading comments...