What is Graft?
Graft is an open-source source-control system for large monorepos used by teams running many agents or CI jobs. It moves repository operations such as history queries, commits, rebases and merges to a server, rather than requiring every client to maintain a full local repository. Developers can work in sparse or virtual checkouts, and many jobs can query or change a repository without a checkout. Graft is an independent implementation of a publicly described source-control design and is licensed under Apache-2.0.
Graft Features:
Server-Side Operations: HTTP APIs handle history, blame, diffs, merge bases, search, commits, rebases and merges on the server.
Change-Based Commits: Commits store changes relative to a first parent and point to content-addressed blobs, with creation work tied to the size of the change.
Lock-Free Landing: The land command rebases changes server-side and updates a ref with compare-and-swap rather than using a global lock or merge queue.
Derived Repository Data: A recursive mechanism builds data for root trees, commit graphs, path history, rename detection, blame and access-control indexes, either eagerly or lazily.
Tiered Fetching: Want-only fetch requests objects through node daemons, regional caches and servers, with immutable objects available for caching across tiers.
Sparse Workspaces: Sparse checkouts and virtual mounts fetch files when needed, keep edits in a local overlay and allow a mount to switch revisions in place.
Access and Review: Repository and directory-level policies govern reads and writes, while review gates can distinguish logic changes from comment-only, whitespace and documentation edits.
Graft Benefits:
Less Client Setup: Agents and CI jobs can query or update source without each maintaining a full clone, reducing work tied to local repository setup and maintenance.
Lower Change Overhead: Because commits represent changesets, small edits do not require work proportional to the full repository size.
Fewer Landing Delays: Concurrent changes can land without waiting for a global lock or passing through a merge queue, reducing contention around shared branches.
Focused Checkouts: Sparse and virtual workspaces let users work with needed files instead of fetching an entire monorepo upfront.
Targeted Reviews: Language-aware review gates can exclude comment, whitespace and documentation-only edits from approvals, helping reviewers focus on behavior-changing work.
Use Cases:
Agent Monorepos: Run many coding agents against a large shared repository while keeping commits and branch updates on the server.
CI Repository Queries: Use server-side search, path history, blame or diffs in jobs that need repository information but do not need a local checkout.
Package-Level Editing: Give a developer or agent a sparse workspace for one service or package while other parts of a monorepo remain unfetched.
Concurrent Branch Landing: Rebase and land changes from multiple workers onto a shared ref without relying on a global merge lock or merge queue.
Protected Directory Reviews: Apply read and write rules to sensitive repository paths and require approvals for changes that affect selected directories.

