Documentation
¶
Overview ¶
Package git implements the statearchive.Archive interface on top of a git orphan branch.
An archive name maps to an orphan branch that shares no history with the application branches. Opening a session checks that branch out into a temporary git worktree, isolated from the application working tree, so state files never appear in the application checkout's "git status". Committing a session commits every change in the worktree and pushes it to the remote when one is configured.
This is the single, shared implementation of the "orphan branch as durable store" primitive that previously lived, duplicated, in both the app graph store and the CLI state code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitArchive ¶
type GitArchive struct{}
GitArchive is a statearchive.Archive backed by git orphan branches. The repository is auto-detected via "git rev-parse --show-toplevel" at Open time, so no path is required up front.
func NewGitArchive ¶
func NewGitArchive() *GitArchive
NewGitArchive returns a git-backed statearchive.Archive.
func (*GitArchive) Open ¶
func (b *GitArchive) Open(ctx context.Context, branch string) (statearchive.Session, error)
Open checks the orphan branch named branch out into a temporary worktree, creating the branch (from the remote, or empty) if it does not yet exist. The returned Session holds a per-branch lock until Close.