vcs
stdlib/extra/vcs.hk: version-control facts for build-time config.
The Vcs effect lets a project's hanki.config.hk read git facts, the commit sha and a describe string, when hanki build evaluates the manifest. hanki build is the host that provides the capability during that evaluation (it injects a handler backed by git); hanki fmt and hanki check never evaluate the manifest, and stay pure and need no git. A program that is not the manifest gets no provider, and calling a vcs op there is an unsatisfied capability and never an unannounced default.
Like every effect op, sha / describe have no module.op call form: a config writes open vcs and calls sha() / describe() bare, or use vcs and reaches them through the effect's name, vcs.Vcs.describe().
Vcs
effect Vcs
sha
def sha() -> string
The current commit's full hexadecimal sha.
@no-doctest: queries the VCS at build time; environment-dependent, and cannot assert in a doctest
describe
def describe() -> string
A git describe --tags --always --dirty string: the nearest tag plus distance and short sha, with a -dirty suffix for uncommitted changes.
@no-doctest: queries the VCS at build time; environment-dependent, and cannot assert in a doctest