Sapling
A scalable and user-friendly source control system designed to simplify development, optimize large repository management, and streamline stacked workflows.
Sapling is a powerful, scalable, and user-friendly source control system originally developed at Meta to handle massive monorepos. Designed to address the limitations of existing version control systems, Sapling prioritizes developer velocity by simplifying complex source control workflows. It allows developers to easily understand their repository, manage stacks of commits, and recover from mistakes with intuitive commands. By separating the user experience and scaling capabilities from the underlying repository format, Sapling provides a modern interface while maintaining compatibility with the Git ecosystem.
Sapling functionality revolves around providing a streamlined CLI and supporting tools that make high-velocity development more accessible. It replaces traditional branch-based workflows with a focus on stacked changes, allowing users to iterate on multiple commits without the hassle of managing individual branches or getting into a detached HEAD state. The system includes robust support for Git repositories, allowing users to clone, interact with, and contribute to existing Git-hosted projects while leveraging Sapling's enhanced UI and workflow features.
Some of the key features are:
- Scalable Architecture: Designed to handle repositories with tens of millions of files, commits, and branches when used with server-side components.
- Stacked Commits: Provides an intuitive workflow for iterating on and submitting work, automatically tracking the head of the stack.
- Interactive Smartlog: Offers a visual representation of your commit graph that makes complex history easy to navigate and understand.
- First-Class Undo: Includes built-in commands like uncommit, unamend, unhide, and undo that allow users to safely reverse operations with a visual preview.
- Git Interoperability: Supports cloning and working with Git repositories, allowing for seamless integration with GitHub and other Git hosting services.
- Simplified UX: Eliminates the need for a complex staging area and provides clear, focused commands that perform single, predictable actions.
- Commit Mutation History: Tracks how commits evolve over time, enabling automatic restacking even when underlying commits are modified or rebased.
- Interactive Web GUI: Includes a web-based interface that provides an interactive view of your repository state and pull request status.
Users interact with Sapling primarily through its command-line interface, which simplifies common tasks through expressive commands and an intuitive commit-tracking model. By focusing on stacks of commits, users can easily navigate up and down their work, amend specific parts of a chain, or rebase stacks without complex manual configurations. The system is designed to be highly reliable, with deep integration for automated testing and recovery procedures, ensuring that developer time is spent on coding rather than fighting with version control state.
Some common use cases include:
- Large-scale Monorepo Management: Handling vast repositories with extensive file history that require high performance and specialized scaling optimizations.
- Stacked Code Reviews: Submitting multiple dependent commits as a series of pull requests, which can be reviewed and updated efficiently.
- Improving Developer Velocity: Providing junior and senior engineers alike with a clearer mental model of their repository through the smartlog and simplified branchless workflows.
- Working with Git Projects: Utilizing the benefits of Sapling’s UX and stacking features while contributing to open-source or existing team projects hosted on GitHub.