| English | 中文 |
Original links:
In Meta’s public materials, Sapling targets massive monorepo scenarios.
The difficulty of such scenarios is not just the sheer number of files, commits, and branches, but also includes:
The value of Sapling lies in addressing scalability and workflow expression simultaneously.
Stacked commits are ideal for breaking a large feature into multiple small steps that can be reviewed individually:
commit A: add data model
commit B: add service logic
commit C: add API
commit D: add tests and docs
Each commit can be reviewed separately, yet they maintain dependency relationships.
This provides specific inspiration for AI coding: AI easily generates large diffs all at once, and humans need to break them back down into an ordered, explainable, and reversible set of small changes.
Sapling’s smartlog emphasizes letting developers intuitively see the location of their local commits, remote mainline, and related branches.
Even if Git users do not use Sapling, they can borrow this idea:
git log --graph --oneline --decorate to assist in understanding historyMeta’s early Scaling Mercurial articles emphasized capabilities like Watchman and remote file log to reduce the costs of status, clone, pull, and rebase.
For Git teams, the corresponding approaches are:
Typical teams do not necessarily need Sapling, but they can adopt these practices:
Stacked commits, worktrees, multi-Agent parallelism, and PR review can be chained into an AI-era workflow:
AI generates solution
-> Human splits into commit stack
-> Each commit reviewed individually
-> CI validates in stack order
-> Mainline remains clean upon merge