Documentation
¶
Overview ¶
Package registry manages the repo registry at ~/.wt/repos.json
Index ¶
- type Registry
- func (r *Registry) Add(repo Repo) error
- func (r *Registry) AddLabel(repoName, label string) error
- func (r *Registry) AllLabels() []string
- func (r *Registry) AllRepoNames() []string
- func (r *Registry) ClearLabels(repoName string) error
- func (r *Registry) Find(ref string) (Repo, error)
- func (r *Registry) FindByLabel(label string) []Repo
- func (r *Registry) FindByLabels(labels []string) []Repo
- func (r *Registry) FindByName(name string) (Repo, error)
- func (r *Registry) FindByPath(path string) (Repo, error)
- func (r *Registry) Remove(nameOrPath string) error
- func (r *Registry) RemoveLabel(repoName, label string) error
- func (r *Registry) Save(path string) error
- func (r *Registry) Update(name string, fn func(*Repo)) error
- type Repo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
Repos []Repo `json:"repos"`
}
Registry holds all registered repos
func Load ¶
Load reads the registry from the specified path, or ~/.wt/repos.json if empty. Returns empty registry if file doesn't exist (auto-creates ~/.wt/).
func (*Registry) AllRepoNames ¶
AllRepoNames returns all repo names
func (*Registry) ClearLabels ¶
ClearLabels removes all labels from a repo
func (*Registry) FindByLabel ¶
FindByLabel returns all repos with the given label
func (*Registry) FindByLabels ¶
FindByLabels returns repos matching any of the given labels
func (*Registry) FindByName ¶
FindByName looks up a repo by name only
func (*Registry) FindByPath ¶
FindByPath looks up a repo by path
func (*Registry) RemoveLabel ¶
RemoveLabel removes a label from a repo
type Repo ¶
type Repo struct {
Path string `json:"path"` // Absolute path to repo
Name string `json:"name"` // Display name
WorktreeFormat string `json:"worktree_format,omitempty"` // Optional per-repo override
Labels []string `json:"labels,omitempty"` // Labels for grouping
}
Repo represents a registered git repository
func (*Repo) GetEffectiveWorktreeFormat ¶
GetEffectiveWorktreeFormat returns the worktree format to use for this repo
func (*Repo) MatchesLabels ¶
MatchesLabels checks if repo has any of the given labels
func (*Repo) PathExists ¶ added in v0.15.0
PathExists returns true if the repo path exists on disk. Returns an error for non-existence errors (e.g. permission denied).