Skip to main content

Module detect

Module detect 

Source
Expand description

Forge, repository, and technology detection.

One pass reads git remote get-url origin: the path is the project, the host chooses the forge. An unrecognized host is never defaulted — a wrong guess runs protection calls against the wrong API and fails partway through a setup — so callers refuse and name the override flags instead. The technology is read from the version file, exactly as the bindings define it.

Structs§

Detection
What one detection pass observed; every field is an observation, and refusing on what is absent is the caller’s decision.

Enums§

Forge
A supported forge.

Functions§

detect
Read the origin remote of dir and map it, without judging.
forge_for_host
The forge a host maps to. gitlab.com and hosts that name gitlab map to GitLab; a self-hosted instance on a host name that says nothing needs --forge.
split_remote
Host and project path from a git remote URL, for the URL and scp-like forms. The path drops a leading slash and a .git suffix.
tech_of
The technology of a repository, read from its version file: Cargo.toml means rust, pyproject.toml means python, a VERSION file means bash.