Documentation
¶
Overview ¶
Package git owns bounded repository reads and native Git mutations on Node. Behavioral adaptations retain sailry-code 67ae9fa0, Apache-2.0 provenance.
Index ¶
- Constants
- func CLIArgs(action protocol.GitAction, branch, operation string, stashPosition int) ([]string, error)
- func IgnorePattern(path string, directory bool) string
- func ParseStatus(data []byte, truncated bool) (protocol.GitStatus, error)
- func ParseWorktrees(data []byte, kind protocol.RepositoryKind, truncated bool) (protocol.GitWorktrees, error)
- func StatusArgs(drivers []string) []string
- type CommandResult
- type Options
- type Runner
- type Service
- func (s *Service) Action(ctx context.Context, root string, input protocol.CommandRunGitActionPayload) error
- func (s *Service) ApplyHunk(ctx context.Context, root string, input protocol.CommandApplyGitHunkPayload) (protocol.GitHunkApplied, error)
- func (s *Service) Blame(ctx context.Context, root string, input protocol.CommandReadGitBlamePayload) (protocol.GitBlame, error)
- func (s *Service) Branches(ctx context.Context, root string) (protocol.GitBranches, error)
- func (s *Service) CaptureManaged(root string) (string, error)
- func (s *Service) Change(ctx context.Context, root string, input protocol.CommandReadGitChangePayload) (protocol.GitChange, error)
- func (s *Service) Changes(ctx context.Context, root string, input protocol.CommandListGitChangesPayload) (protocol.GitChanges, error)
- func (s *Service) Check(ctx context.Context, root, index string, expectedHead, branch *string) error
- func (s *Service) Clone(ctx context.Context, repositoryURL, destination string, branch *string) (string, error)
- func (s *Service) Commit(ctx context.Context, root, revision string) (protocol.GitCommit, error)
- func (s *Service) Context(ctx context.Context, root string, input protocol.CommandReadGitContextPayload) (protocol.GitContext, error)
- func (s *Service) CreateBranch(ctx context.Context, root, name, commit string) (protocol.GitBranch, error)
- func (s *Service) CreateCommit(ctx context.Context, root string, input protocol.CommandCreateGitCommitPayload) (protocol.OutputGitCommitCreatedPayload, error)
- func (s *Service) CreateManagedWorktree(ctx context.Context, source, main string, id protocol.WorktreeID, ...) (string, error)
- func (s *Service) CreateWorktree(ctx context.Context, root, destination, branch, commit string) (string, error)
- func (s *Service) DeleteBranch(ctx context.Context, root string, input protocol.CommandDeleteGitBranchPayload) error
- func (s *Service) Diff(ctx context.Context, root, path string, scope protocol.GitDiffScope) (protocol.GitDiff, error)
- func (s *Service) EditIndex(ctx context.Context, root, path, expectedIndex string, expectedHead *string, ...) (protocol.GitIndex, error)
- func (s *Service) Execute(ctx context.Context, root string, command protocol.Command) (protocol.Output, error)
- func (s *Service) Head(ctx context.Context, root string) (protocol.GitHead, error)
- func (s *Service) Ignore(ctx context.Context, root string, paths []string, directories bool) error
- func (s *Service) Invalidate(root string)
- func (s *Service) ListWorktrees(ctx context.Context, root string) (protocol.GitWorktrees, error)
- func (s *Service) Log(ctx context.Context, root string, input protocol.CommandReadGitLogPayload) (protocol.GitLog, error)
- func (s *Service) MergeBranch(ctx context.Context, root string, input protocol.CommandMergeGitBranchPayload) (protocol.GitMerge, error)
- func (s *Service) NewWatchFilter(ctx context.Context, root string) (*WatchFilter, []string, error)
- func (s *Service) Output(root string) string
- func (s *Service) PrepareManaged(root string) (string, error)
- func (s *Service) PruneWorktree(ctx context.Context, root, path string) error
- func (s *Service) Read(ctx context.Context, root string, command protocol.Command) (protocol.Output, error)
- func (s *Service) RemoteTags(ctx context.Context, root, remote string) ([]protocol.GitTag, error)
- func (s *Service) RemoveWorktree(ctx context.Context, root, expectedHead, expectedBranch string) error
- func (s *Service) RenameBranch(ctx context.Context, root, name, newName, commit string) (protocol.GitBranch, error)
- func (s *Service) Show(ctx context.Context, root string, input protocol.CommandReadGitShowPayload) (protocol.Output, error)
- func (s *Service) Status(ctx context.Context, root string) (protocol.GitStatus, error)
- func (s *Service) SwitchBranch(ctx context.Context, root string, input protocol.CommandSwitchGitBranchPayload) (protocol.GitBranch, error)
- func (s *Service) UpdateIndex(ctx context.Context, root string, input protocol.CommandUpdateGitIndexPayload) (protocol.GitIndex, error)
- type WatchFilter
Constants ¶
const ( BranchExists = "branch already exists" BranchInWorktree = "branch belongs to another worktree" DestinationExists = "destination already exists" WorktreeLocked = "worktree is locked" WorktreeDirty = "worktree has uncommitted changes" WorktreePathExists = "worktree path still exists" )
Messages of the branch and worktree faults that share a code with other causes. A controller compares a fault's message with these to name the cause; any other message keeps the copy of its code.
Variables ¶
This section is empty.
Functions ¶
func CLIArgs ¶
func CLIArgs(action protocol.GitAction, branch, operation string, stashPosition int) ([]string, error)
CLIArgs preserves native argv without executing a shell. Repository-dependent validation and compound operations remain in Action.
func IgnorePattern ¶
func ParseStatus ¶
ParseStatus reads source-native porcelain v2, including its NUL-framed paths.
func ParseWorktrees ¶
func ParseWorktrees(data []byte, kind protocol.RepositoryKind, truncated bool) (protocol.GitWorktrees, error)
func StatusArgs ¶
Types ¶
type CommandResult ¶
type Options ¶
type Options struct {
Run Runner
Now func() time.Time
Environment []string
Profile string
// Lock orders run_git_action and create_git_commit with the owner's other
// effects on a root. The service takes it around their local work and
// leaves transfers with a remote outside it.
Lock func(root string) (unlock func())
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ApplyHunk ¶
func (s *Service) ApplyHunk(ctx context.Context, root string, input protocol.CommandApplyGitHunkPayload) (protocol.GitHunkApplied, error)
ApplyHunk verifies the complete displayed patch before selecting a single working-tree hunk. It shares the same confined files and index publisher as checkpoint review, without claiming a conversation checkpoint identity.
func (*Service) CaptureManaged ¶
CaptureManaged returns the source sandbox's protected child-checkout boundary. Repository preparation reuses the single managed/exclude mutation owner.
func (*Service) Changes ¶
func (s *Service) Changes(ctx context.Context, root string, input protocol.CommandListGitChangesPayload) (protocol.GitChanges, error)
func (*Service) Context ¶
func (s *Service) Context(ctx context.Context, root string, input protocol.CommandReadGitContextPayload) (protocol.GitContext, error)
func (*Service) CreateBranch ¶
func (*Service) CreateCommit ¶
func (s *Service) CreateCommit(ctx context.Context, root string, input protocol.CommandCreateGitCommitPayload) (protocol.OutputGitCommitCreatedPayload, error)
func (*Service) CreateManagedWorktree ¶
func (s *Service) CreateManagedWorktree(ctx context.Context, source, main string, id protocol.WorktreeID, input protocol.CommandCreateManagedWorktreePayload) (string, error)
CreateManagedWorktree copies captured changes into a new owned checkout. The source worktree and index are never modified or stashed.
func (*Service) CreateWorktree ¶
func (*Service) DeleteBranch ¶
func (*Service) EditIndex ¶
func (s *Service) EditIndex(ctx context.Context, root, path, expectedIndex string, expectedHead *string, expectedSource string, transform func(string) (string, error)) (protocol.GitIndex, error)
EditIndex transforms the current staged text and compares the observed working file revision again immediately before publishing the detached index candidate.
func (*Service) Invalidate ¶
func (*Service) ListWorktrees ¶
func (*Service) MergeBranch ¶
func (*Service) NewWatchFilter ¶ added in v0.2.7
func (*Service) PruneWorktree ¶
func (*Service) RemoteTags ¶
func (*Service) RemoveWorktree ¶
func (*Service) RenameBranch ¶
func (*Service) SwitchBranch ¶
type WatchFilter ¶
type WatchFilter struct {
// contains filtered or unexported fields
}
func NewWatchFilter ¶
func NewWatchFilter(root string) (*WatchFilter, error)
func (*WatchFilter) Changed ¶
func (f *WatchFilter) Changed(paths []string) bool
func (*WatchFilter) ReferencesChanged ¶
func (f *WatchFilter) ReferencesChanged(paths []string) bool
Source Files
¶
- actions.go
- blame.go
- branches.go
- changes.go
- clean.go
- diff.go
- dispatch.go
- durability.go
- durability_unix.go
- history.go
- hunk.go
- identity_unix.go
- ignore.go
- index.go
- managed.go
- mutations.go
- native.go
- native_command_linux.go
- native_unix.go
- pull.go
- reference_locks.go
- service.go
- staging.go
- status.go
- status_fault.go
- watch.go
- worktree_config.go
- worktrees.go