Documentation
¶
Overview ¶
Package repolabel derives the owner-independent display label for a git repository, used as the `origin_repo` group key on worktree listings. Leaf package so any layer can compute the same label without cross-imports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeRepoLabel ¶
ComputeRepoLabel returns the owner-independent display label for the repo rooted at repoPath. Prefers `git remote get-url origin` so forks of the same directory name stay distinguishable; falls back to the basename of repoPath when no remote is configured.
The returned value is persisted as `origin_repo` on the worktree row (see sync.Worktree.OriginRepo) and consumed by clients (mobile picker, TUI sidebar) as the group key when rendering worktrees by repo.
func RepoLabelFromURL ¶
RepoLabelFromURL derives a display label from a git remote URL. When the URL contains an owner segment, the label is "owner/repo" so forks of the same repo name remain distinguishable in the UI. When only a single path segment is present, the bare repo name is returned. fallback is used when the URL cannot be parsed into a meaningful name.
Examples:
"https://github.com/acme/api.git" → "acme/api" "git@github.com:acme/api.git" → "acme/api" "https://github.com/acme/api" → "acme/api" "https://example.com/api" → "api"
Types ¶
This section is empty.