Documentation
¶
Overview ¶
Package git attributes workspace changes relative to an in-memory-owned baseline using fixed read-only Git commands.
Index ¶
- Variables
- type Config
- type Inspector
- func (i *Inspector) Capture(ctx context.Context) (changes.Snapshot, error)
- func (i *Inspector) Changes(ctx context.Context, snapshot changes.Snapshot) (_ changes.Report, returnErr error)
- func (i *Inspector) Close() error
- func (i *Inspector) ExcludeLocal(ctx context.Context, name string) error
- func (i *Inspector) ListWorkspaceFiles(ctx context.Context) ([]string, bool, error)
- func (i *Inspector) Status(ctx context.Context) (changes.WorktreeStatus, error)
- func (i *Inspector) Tracked(ctx context.Context, name string) (bool, bool, error)
- type Limits
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotRepository means the workspace is not inside a Git work tree. ErrNotRepository = errors.New("coding git changes: workspace is not a repository") // ErrSnapshotExpired means a snapshot is stale, consumed, foreign, or forged. ErrSnapshotExpired = errors.New("coding git changes: snapshot expired") // ErrLimit means a bounded scan, copy, command, or diff budget was exceeded. ErrLimit = errors.New("coding git changes: resource limit exceeded") // ErrGit means a fixed read-only Git command failed. ErrGit = errors.New("coding git changes: git command failed") // ErrClosed means an Inspector was used after Close. ErrClosed = errors.New("coding git changes: inspector closed") )
Functions ¶
This section is empty.
Types ¶
type Inspector ¶
type Inspector struct {
// contains filtered or unexported fields
}
Inspector owns single-use content baselines for one Workspace.
func New ¶
func New( ws workspace.Workspace, tree *workspace.Tree, policy execution.Policy, executor *execution.Executor, config Config, ) (*Inspector, error)
New constructs a read-only Git change Inspector.
func (*Inspector) Changes ¶
func (i *Inspector) Changes( ctx context.Context, snapshot changes.Snapshot, ) (_ changes.Report, returnErr error)
Changes consumes a Snapshot and reports worktree changes since Capture.
func (*Inspector) ExcludeLocal ¶
ExcludeLocal adds an anchored path to the repository's local info/exclude. It never modifies the shared .gitignore file.
func (*Inspector) ListWorkspaceFiles ¶
ListWorkspaceFiles returns tracked and non-ignored untracked repository paths in stable order. repository is false only outside a Git worktree.
type Limits ¶
type Limits struct {
Files int
HashBytes int64
CopyBytes int64
DiffFileBytes int64
GitBytes int64
DiffBytes int64
GitTimeout time.Duration
InspectTime time.Duration
}
Limits bounds repository discovery, hashing, baseline copies, and output.
func DefaultLimits ¶
func DefaultLimits() Limits
DefaultLimits returns conservative P0 Git inspection budgets.