Documentation
¶
Index ¶
- Variables
- func AgeDays(path string) (int, error)
- func AgeHours(path string) (int, error)
- func CleanAllStaleLocks(cfg *config.Config)
- func CleanStaleLocks(cfg *config.Config, repo string)
- func LastActivity(path string) (time.Time, error)
- func ParseBranchFromName(name string) string
- func ParseRepoFromName(name string) string
- type Stats
- type Type
- type Worktree
Constants ¶
This section is empty.
Variables ¶
var GitMu sync.Mutex
GitMu serializes git worktree operations to prevent concurrent index.lock conflicts.
Functions ¶
func CleanAllStaleLocks ¶
CleanAllStaleLocks cleans stale locks across all known repos.
func CleanStaleLocks ¶
CleanStaleLocks removes stale index.lock files from worktrees of the given repo. A lock is considered stale if the PID inside it is no longer running.
func LastActivity ¶
LastActivity returns the date of the last commit in the worktree.
func ParseBranchFromName ¶
ParseBranchFromName extracts the branch suffix from a worktree directory name. e.g., "mono-feature-branch" -> "feature-branch"
func ParseRepoFromName ¶
ParseRepoFromName extracts the repo short name from a worktree directory name. e.g., "mono-pr-1234" -> "mono"
Types ¶
type Stats ¶
type Stats struct {
Total int `json:"total"`
PRReviews int `json:"pr_reviews"`
Features int `json:"features"`
ByRepo map[string]int `json:"by_repo"`
}
Stats holds worktree statistics.
type Worktree ¶
type Worktree struct {
Path string `json:"path"`
Name string `json:"name"`
Branch string `json:"branch"`
Type Type `json:"type"`
PRNumber int `json:"pr_number,omitempty"`
Repo string `json:"repo"`
}
Worktree represents a discovered git worktree.