Documentation
¶
Overview ¶
Package jujutsu provides jj (Jujutsu) VCS operations for agent-deck. It mirrors the internal/git package pattern with package-level functions that execute jj CLI commands.
Index ¶
- func AbortMerge(repoDir string) error
- func GetMainWorktreePath(dir string) (string, error)
- func GetRepoRoot(dir string) (string, error)
- func GetWorktreeBaseRoot(dir string) (string, error)
- func IsDefaultWorkspace(dir string) (bool, error)
- func IsJJRepo(dir string) bool
- func IsWorktree(dir string) bool
- type JJBackend
- func (b *JJBackend) BranchExists(branchName string) bool
- func (b *JJBackend) CheckoutBranch(branchName string) error
- func (b *JJBackend) CreateWorktree(workspacePath, branchName string) error
- func (b *JJBackend) DeleteBranch(branchName string, force bool) error
- func (b *JJBackend) GetCurrentBranch() (string, error)
- func (b *JJBackend) GetDefaultBranch() (string, error)
- func (b *JJBackend) GetWorktreeForBranch(branchName string) (string, error)
- func (b *JJBackend) HasUncommittedChanges() (bool, error)
- func (b *JJBackend) ListWorktrees() ([]vcs.Worktree, error)
- func (b *JJBackend) MergeBranch(branchName string) error
- func (b *JJBackend) PruneWorktrees() error
- func (b *JJBackend) RemoveWorktree(workspacePath string, force bool) error
- func (b *JJBackend) RepoDir() string
- func (g *JJBackend) Type() vcs.Type
- func (b *JJBackend) WorktreePath(opts vcs.WorktreePathOptions) string
- type Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbortMerge ¶
AbortMerge undoes the last operation (equivalent to aborting a merge).
func GetMainWorktreePath ¶
GetMainWorktreePath returns the path to the default workspace.
func GetRepoRoot ¶
GetRepoRoot returns the root directory of the jj repository.
func GetWorktreeBaseRoot ¶
GetWorktreeBaseRoot returns the default workspace path (equivalent to main worktree in git).
func IsDefaultWorkspace ¶
IsDefaultWorkspace returns true if the given directory is the default workspace.
func IsJJRepo ¶
IsJJRepo checks if the given directory is inside a jj repository by running `jj root`. Returns false if jj is not installed or the directory is not a jj repo.
func IsWorktree ¶
IsWorktree checks if the directory is a non-default jj workspace.
Types ¶
type JJBackend ¶
type JJBackend struct {
// contains filtered or unexported fields
}
func NewJJBackend ¶
func (*JJBackend) BranchExists ¶
BranchExists checks if a bookmark exists in the repository.
func (*JJBackend) CheckoutBranch ¶
CheckoutBranch moves the working copy to a new change based on the given bookmark.
func (*JJBackend) CreateWorktree ¶
CreateWorktree creates a new jj workspace at the given path.
func (*JJBackend) DeleteBranch ¶
DeleteBranch deletes a bookmark.
func (*JJBackend) GetCurrentBranch ¶
GetCurrentBranch returns the first bookmark of the current working-copy change.
func (*JJBackend) GetDefaultBranch ¶
GetDefaultBranch returns the default branch name (checks for main/master bookmarks).
func (*JJBackend) GetWorktreeForBranch ¶
func (*JJBackend) HasUncommittedChanges ¶
HasUncommittedChanges checks if the working copy has uncommitted changes.
func (*JJBackend) ListWorktrees ¶
ListWorktrees returns all workspaces for the repository.
func (*JJBackend) MergeBranch ¶
MergeBranch creates a merge change combining the current change with the given bookmark.
func (*JJBackend) PruneWorktrees ¶
PruneWorktrees removes workspace entries whose directories no longer exist.
func (*JJBackend) RemoveWorktree ¶
RemoveWorktree forgets a workspace and optionally removes its directory.
func (*JJBackend) WorktreePath ¶
func (b *JJBackend) WorktreePath(opts vcs.WorktreePathOptions) string
WorktreePath generates a workspace path using the backend's repoDir. Delegates to the shared template logic in the git package (VCS-agnostic).