Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrClosed = errors.New("rewind manager closed")
ErrClosed is returned after Cleanup; callers should treat it as a transient no-op (RestartRewind installs a fresh Manager).
Functions ¶
func CleanupOrphans ¶ added in v0.6.2
func CleanupOrphans()
CleanupOrphans removes leftover shadow repos from prior crashed sessions. Only deletes dirs older than the cutoff so concurrent sessions are safe.
Types ¶
type FileDiff ¶
type FileDiff struct {
Path string
Status FileStatus
Patch string
Original string
Modified string
}
type FileStatus ¶
type FileStatus int
const ( StatusAdded FileStatus = iota StatusModified StatusDeleted )
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager runs a shadow git repo in /tmp that snapshots the working dir on each user turn. Init is async; methods block on initDone until ready.
func (*Manager) DiffFromBaseline ¶
DiffFromBaseline diffs the baseline against the live working tree (not HEAD), so changes from any source — agent tools, terminal, external editor — are reflected. Returns (nil, nil) when there's no diff; errors are reserved for actual git failures.
func (*Manager) Fingerprint ¶ added in v0.6.2
Fingerprint returns a 64-bit digest of the worktree's visible state (relative path, mtime, size for every non-ignored file). Doesn't hash content, so a `touch` will fire a refetch even when no diff changed.
func (*Manager) List ¶
func (m *Manager) List() ([]Checkpoint, error)