Graphite Reviewer is now Diamond
Managing complex dependencies with Graphite

Managing complex dependencies with Graphite

Sara Verdi
Sara Verdi
Graphite software engineer
Try Graphite

For teams managing complex dependency chains, manually rebasing and coordinating merge orders can slow you down and introduce errors. Imagine working on a project where one feature relies on another: the first pull request (PR) implements a crucial refactor, the second adds functionality built on that refactor, and the third layers additional enhancements on top. Without an automated system to handle these dependencies, manual merging can result in a handful of issues, including:

  • Manual rebasing of downstream PRs whenever an upstream change is updated.
  • Increased merge conflicts when dependencies are merged out of order.
  • Extended wait times as teams coordinate merges and re-run tests after every manual rebase.

These challenges not only slow down development but also increase the risk of integrating errors that can derail releases.

Graphite tackles these issues with two key features:

Graphite enables stacking, the version control workflow developed at Meta and Google that enables developers to segment their work into manageable parts, push changes up for review as they go, and never be blocked waiting for feedback. With this approach,

  • PRs become easier to review and test
  • Graphite re-stacks the dependent branches automatically
  • The risk of merge conflicts is reduced, as each change is verified in the context of its dependencies

This means that developers can continue working on subsequent changes without waiting for earlier PRs to merge—keeping the team’s momentum uninterrupted. For example, since adopting the stacking workflow with Graphite, engineers at Asana have saved roughly 7 hours each week and increased their code output by 21%

The Graphite Merge Queue is stack-aware, so it’s adept at handling interdependent changes. Here’s how it works:

  1. When a pull request is added to the queue, Graphite automatically creates a temporary branch that combines the latest code from the target branch with all the queued PR changes.
  2. Graphite then runs CI tests on this temporary branch to ensure that the integrated changes will not break the trunk.
  3. Finally, Graphite merges the pull requests in a controlled, sequential order based on their dependency chain, which reduces the likelihood of introducing conflicts.

By automating the rebase and merge process, the merge queue minimizes manual intervention, lowers the risk of errors, and keeps your main branch consistently “green.”

Using Graphite to manage stacked PRs and a merge queue offers several advantages:

  • Faster iteration: Incremental changes can be reviewed and merged without long delays, accelerating feature delivery.
  • Improved stability: Automated testing on the combined changes helps catch integration issues before they reach production.
  • Increased productivity: Developers spend less time manually coordinating merges and more time writing code.
  • Minimized technical debt: By reducing the likelihood of bugs and costly rollbacks, Graphite allows developers to focus on delivering business-critical improvements rather than struggling with integration issues.

If your team is struggling with the overhead of managing complex dependency chains, it’s time to consider a new solution. Graphite’s powerful automation for dependency management not only simplifies your merge process but also helps maintain a stable, production-ready codebase—even when change is happening at a rapid pace. Get started today:

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