Documentation
¶
Overview ¶
Package vcs provides version-control detection that works across git and Jujutsu (jj) repositories. It dispatches to the pure-Go gitfs and jjfs helpers, and shells out to git for remote-URL detection (jj's backend is a git repo, so no jj binary is required).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Detect ¶
Detect reports which version-control systems are present at or above dir, in stable order ("git" before "jj"). A colocated jj/git repo returns both; native jj returns only "jj"; a plain git repo returns only "git". Returns an empty (non-nil) slice when neither is found. Pure filesystem walk — no git or jj binary is invoked.
func DetectMainRepo ¶
DetectMainRepo returns the canonical main-repo working directory if dir is inside a linked git worktree or a secondary jj workspace; otherwise "". git is tried first, jj is the fallback. The result is canonicalized via core.NormalizePath so it matches registered (canonical) project paths.
func DetectRemote ¶
DetectRemote returns the origin remote URL for the repo containing dir, or "". It tries `git -C dir remote get-url origin` first (covers plain git and colocated jj). On failure it retries against the jj backing git directory (covers native jj). No jj binary is invoked.
Types ¶
This section is empty.