Reflect on your 2024 year in code

Code reviews are particularly challenging for distributed teams. Engineers spanning different time zones face a common frustration—the prolonged wait for feedback on their pull requests. When a developer in Tokyo submits code at 1 PM their time, they're forced to wait at least 12 hours before their San Francisco-based reviewer even starts their day. This creates substantial dead time, forcing engineers to either sit idle or context-switch to entirely different tasks—both of which kill productivity and momentum.

The traditional approach to code review only compounds this problem. Gitflow and other feature branch-based workflows effectively limit each developer to one branch, one open PR, and one pending review at a time. This means development comes to halt while waiting for feedback on each change, creating a wave of delays that distributed teams feel most acutely. Additionally, as developers batch changes together to keep themselves unblocked, they often end up creating large, monolithic PRs, making reviews even more time-consuming and less thorough.

But code review doesn’t have to be difficult for remote teams. In this post, we’ll explore how the stacked PRs workflow can keep engineers unblocked and productive across locations and time zones.

In the stacking workflow, developers can create a series of smaller, logically separated PRs that build upon each other, rather than waiting for each PR to be fully reviewed and merged before starting work on dependent changes. The key advantage of this approach is that it parallelizes the review and development workstreams, allowing code authors to continue writing (“stacking on”) subsequent, dependent changes while waiting for their existing PRs to be reviewed. When reviews come back, developers use stacking tools like Graphite to help them apply any requested changes up through the whole stack, rather than having to resolve the same rebase conflicts in every subsequent branch. Stacking not only improves the DevEx of authoring code changes, but it also makes reviewing PRs significantly less painful by encouraging small, atomic PRs that are easier to understand and require fewer codeowner approvals.

For distributed teams, stacking PRs provides several benefits:

Parallelizing review and development 

The ability to parallelize review and development is the most critical advantage of stacked PRs for distributed teams. That Tokyo-based developer no longer needs to wait for their San Francisco colleague to wake up—with stacked PRs, they can continue building on their initial changes and never be blocked waiting for feedback. When SF finally does wake up, they can review each PR in the stack, and a stacking tool such as Graphite will help the Tokyo team apply the requested changes to everything they’ve built (“stacked”) on top. 

The time savings for distributed teams is massive. What might previously have taken days of stop-and-go, back-and-forth review cycles now happens as a continuous flow of work around the clock, so your changes ship in a fraction of the time.

Improved visibility, better dependency management, and minimized merge conflicts

Stacking helps code authors strategically divide large changes into logical, manageable segments that correspond with specific areas of the codebase. Not only does this provide better visibility of large code changes and progress on features, it also allows each part of the change—whether it's the frontend, database, or API—to be reviewed by experts in that particular domain. Reviewers can then focus on specific areas without the cognitive load of sifting through unrelated code.  

Furthermore, because changes are organized sequentially, dependency management is simplified, which consequently minimizes merge conflicts. Stacking allows developers to focus on smaller changes and make adjustments in earlier PRs without worrying about the significant merge conflicts that often accompany larger, longer-lived feature branches.

Many of the largest and fastest-moving software companies, including Meta, Google, and Uber, as well as remote-first teams like The Browser Co, have successfully implemented stacked PR workflows into their development processes. For distributed teams looking to adopt this method, the right tools and processes are a necessity. Here are some pointers for a smooth transition: 

  • Educate your team. Before introducing new tools, invest time in helping your team understand the stacking workflow. This could look like holding training sessions that help developers understand how to break down larger changes into smaller, logical PRs. 

  • Adopt stacking-friendly tools and processes. Use a tool like Graphite to make stacking PRs seamless. You can also set up Graphite’s Merge Queue to automate the merge process so stacked PRs can flow smoothly into the main branch. 

  • Develop clear conventions for branch organization. Establish a standardized naming scheme that reflects PR dependencies, document branch hierarchy patterns, and set protocols for managing changes across multiple stack levels to maintain clarity and order within your preferred version control system.

  • Prioritize clear communication. Use detailed descriptions and changelogs to document dependencies between PRs and set up notification systems that keep all stakeholders informed of stack status. With Graphite, you can get detailed, AI-generated PR descriptions in seconds. 

  • Optimize CI pipelines. Running CI tests on each PR in isolation guarantees that individual changes are reliable before they’re merged.

To begin simplifying async code reviews and minimize wait times, distributed teams can use Graphite, an end-to-end pull request platform with tools for creating, reviewing, and merging stacked PRs. Graphite is built on top of Git and GitHub, so you can start stacking without disrupting your team’s workflows and tooling. Plus, Graphite’s Merge Queue automates rebasing and validates entire stacks at once, so teams in different time zones can easily merge their changes and keep the main branch stable. Companies like Asana have already seen dramatic results from stacking with Graphite, with engineers saving up to 7 hours per week on code reviews. To learn more about how your distributed teams can save time and start stacking with Graphite, check out our documentation or book a demo with our team.

Built for the world's fastest engineering teams, now available for everyone