Documentation
¶
Overview ¶
Package gitcontrol runs the fixed Git plumbing operations required by the Coding Team Worktree control plane.
It deliberately exposes typed operations instead of arbitrary process arguments. The package is trusted application infrastructure, not a model-callable shell or an Approval bypass.
Index ¶
- Variables
- type Commit
- type IndexEntry
- type Limits
- type RefUpdate
- type Repository
- type Runner
- func (r *Runner) AddWorktree(ctx context.Context, directory, path, branch, reason string) error
- func (r *Runner) CatBlob(ctx context.Context, directory, oid string) ([]byte, error)
- func (r *Runner) CheckIgnored(ctx context.Context, directory string, paths []string) (map[string]struct{}, error)
- func (r *Runner) CommitTree(ctx context.Context, directory string, commit Commit) (string, error)
- func (r *Runner) CreateRef(ctx context.Context, directory, objectFormat, ref, oid, reason string) error
- func (r *Runner) DeleteRef(ctx context.Context, directory, ref, oldOID, reason string) error
- func (r *Runner) HashBlob(ctx context.Context, directory string, content []byte) (string, error)
- func (r *Runner) InspectRepository(ctx context.Context, directory string) (Repository, error)
- func (r *Runner) ListTree(ctx context.Context, directory, treeOID string) ([]TreeEntry, error)
- func (r *Runner) LockWorktree(ctx context.Context, directory, path, reason string) error
- func (r *Runner) ReadTree(ctx context.Context, directory, indexPath, treeOID string) error
- func (r *Runner) RemoveWorktree(ctx context.Context, directory, path string) error
- func (r *Runner) ResolveCommit(ctx context.Context, directory, value string) (string, error)
- func (r *Runner) ResolveRef(ctx context.Context, directory, ref string) (string, error)
- func (r *Runner) ResolveTree(ctx context.Context, directory, commitOID string) (string, error)
- func (r *Runner) SnapshotStatus(ctx context.Context, directory string) (Status, error)
- func (r *Runner) UnlockWorktree(ctx context.Context, directory, path string) error
- func (r *Runner) UnmergedIndex(ctx context.Context, directory, indexPath string) (bool, error)
- func (r *Runner) UpdateIndex(ctx context.Context, directory, indexPath, objectFormat string, ...) error
- func (r *Runner) UpdateRefs(ctx context.Context, directory, objectFormat, reason string, ...) error
- func (r *Runner) ValidateSafeConfig(ctx context.Context, directory string) error
- func (r *Runner) Worktrees(ctx context.Context, directory string) ([]Worktree, error)
- func (r *Runner) WriteTree(ctx context.Context, directory, indexPath string) (string, error)
- type Status
- type TreeEntry
- type Worktree
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalid means an operation value cannot name a safe fixed Git command. ErrInvalid = errors.New("coding git control: invalid operation") // ErrUnsupported means the current platform cannot provide the required // process and filesystem identity guarantees. ErrUnsupported = errors.New("coding git control: unsupported platform") // ErrExecutableChanged means the injected Git executable was replaced. ErrExecutableChanged = errors.New("coding git control: executable identity changed") // ErrLimit means a command input, output, or time budget was exceeded. ErrLimit = errors.New("coding git control: resource limit exceeded") // ErrGit means a fixed Git command did not complete successfully. ErrGit = errors.New("coding git control: git command failed") // ErrNotFound means an exact ref, object, or Worktree record is absent. ErrNotFound = errors.New("coding git control: resource not found") // ErrConflict means an expected-old-value or exact identity did not match. ErrConflict = errors.New("coding git control: identity conflict") // ErrUnsafeConfig means repository configuration could execute external code. ErrUnsafeConfig = errors.New("coding git control: unsafe repository config") )
Functions ¶
This section is empty.
Types ¶
type IndexEntry ¶
IndexEntry is one exact temporary-index cache entry. Mode "0" deletes Path.
type Limits ¶
Limits bounds every trusted Git process and parsed collection.
func DefaultLimits ¶
func DefaultLimits() Limits
DefaultLimits returns conservative production Git-control budgets.
type Repository ¶
type Repository struct {
TopLevel string
GitDir string
CommonDir string
ObjectFormat string
HeadOID string
BranchRef string
}
Repository is one resolved Git repository/worktree identity projection.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner executes only the package's fixed Git operation families.
func (*Runner) AddWorktree ¶
AddWorktree creates an already-locked linked Worktree without checkout.
func (*Runner) CheckIgnored ¶
func (r *Runner) CheckIgnored(ctx context.Context, directory string, paths []string) (map[string]struct{}, error)
CheckIgnored returns the input paths ignored by repository rules.
func (*Runner) CommitTree ¶
CommitTree creates one single-parent commit from exact plumbing inputs.
func (*Runner) CreateRef ¶
func (r *Runner) CreateRef( ctx context.Context, directory, objectFormat, ref, oid, reason string, ) error
CreateRef CAS-creates ref at oid.
func (*Runner) HashBlob ¶
HashBlob stores raw bytes without attributes or filters and returns the OID.
func (*Runner) InspectRepository ¶
InspectRepository resolves repository identity and exact HEAD metadata.
func (*Runner) LockWorktree ¶
LockWorktree locks one exact linked Worktree with the owned reason.
func (*Runner) RemoveWorktree ¶
RemoveWorktree removes one clean exact linked Worktree without force.
func (*Runner) ResolveCommit ¶
ResolveCommit resolves value and requires a commit object.
func (*Runner) ResolveRef ¶
ResolveRef returns the exact OID stored in ref.
func (*Runner) ResolveTree ¶
ResolveTree returns the exact tree OID for one commit OID.
func (*Runner) SnapshotStatus ¶
SnapshotStatus returns a stable digest of tracked and untracked Worktree state without refreshing or mutating the index.
func (*Runner) UnlockWorktree ¶
UnlockWorktree unlocks one exact linked Worktree.
func (*Runner) UnmergedIndex ¶
UnmergedIndex returns whether indexPath contains an unmerged entry.
func (*Runner) UpdateIndex ¶
func (r *Runner) UpdateIndex( ctx context.Context, directory, indexPath, objectFormat string, entries []IndexEntry, ) error
UpdateIndex replaces temporary-index entries using the machine NUL protocol.
func (*Runner) UpdateRefs ¶
func (r *Runner) UpdateRefs( ctx context.Context, directory, objectFormat, reason string, updates []RefUpdate, ) error
UpdateRefs publishes one atomic expected-value ref transaction.
func (*Runner) ValidateSafeConfig ¶
ValidateSafeConfig rejects effective repository configuration that can execute an external program in a lifecycle command.