Understanding Stacked Diffs
Stacked diffs, also known as stacked changes or dependent changes, refer to a series of code changes where each change is based on the code of the previous one. This allows developers to break down large features or changes into smaller, more manageable reviews.
The Workflow
The typical workflow for stacked diffs involves:
Creating a base diff that introduces the initial set of changes.
Stacking subsequent diffs on top of the base diff, each depending on the changes introduced by the previous diff.
Reviewing and landing changes one at a time, starting from the base and moving up the stack.
Phabricator's Implementation
Phabricator introduced a structured way to manage stacked diffs through Differential, its code review tool, and Arcanist, the command-line interface.
Differential
Differential supports the creation and management of diffs, handling dependencies between diffs transparently.
It allows reviewers to see the context of each diff in a stack, focusing on the incremental changes rather than the entire codebase.
Arcanist
Arcanist facilitates the creation of stacked diffs with commands like
arc diff
, which can automatically recognize and manage dependencies.It streamlines the process of updating stacked diffs, handling the intricate rebasing and updating that can often be involved.
Influence on Code Review Culture
Phabricator's approach to stacked diffs has had several significant influences on code review culture:
Incremental Reviews: Encouraged the practice of breaking down complex features into smaller, more digestible pieces for review.
Collaboration: Fostered a more collaborative environment where reviewers can provide feedback early and often throughout the development process.
Efficiency: Improved the efficiency of the review process by allowing parallel work on dependent changes without waiting for a full merge.
Adoption and Adaptation
While Phabricator was instrumental in pioneering the stacked diffs workflow, other tools and platforms have since adopted and adapted this concept:
Popularization: The stacked diffs workflow has become more widespread, with other development platforms integrating similar functionalities.
Innovation: The concept has evolved, with the community building upon and refining the workflow, leading to new tools and integrations that further streamline the process.
Conclusion
Phabricator's introduction of the stacked diffs workflow marked a pivotal moment in the evolution of code review practices. It demonstrated a powerful model for managing complex changesets, which has since been embraced and expanded upon by the software development community. The legacy of Phabricator's approach to stacked diffs continues to influence and inform the development workflows and tools of today, underscoring the importance of iterative, incremental, and collaborative code reviews in the pursuit of software excellence.