Skip to main content

Module vcs

Module vcs 

Source
Expand description

Version-control-agnostic identity resolution.

wipe stores its board in a repo, but that repo isn’t always git: teams on Plastic SCM (Unity VCS), Mercurial, SVN, Fossil, or Jujutsu should still get real attribution instead of “unknown”. This module detects the VCS in use and asks it who the current user is, shelling out to each tool best-effort (a missing tool or non-repo simply yields None, never an error).

Enums§

Vcs
A recognized version-control system hosting the repo.

Functions§

authors
Distinct historical authors as (name, email), best-effort. Only git and Mercurial expose this cheaply; others return an empty list.
detect
Walk up from start looking for a VCS marker. The first match wins; .git and .plastic are checked together at each level so a nested layout resolves to the closest enclosing workspace.
identity
The current user’s identity as reported by the repo’s VCS (Name <email> when available), or None if there’s no VCS, the tool is missing, or it’s unset.
system_user
The OS account name ($USERNAME on Windows, $USER elsewhere), a last-ditch identity when no VCS can supply one.