Skip to content

v.util.version #

Compiler version information

githash(path) reads the current commit of a Git checkout and returns its first seven characters. It supports ordinary checkouts and linked worktrees, including detached HEADs. Branch refs can be stored in loose files or packed-refs; loose files take precedence. Missing refs and malformed packed entries produce an error instead of a hash.

Constants #

const v_version = '0.5.2'

fn full_hash #

fn full_hash() string

fn full_v_version #

fn full_v_version(is_verbose bool) string

full_v_version() returns the full version of the V compiler

fn githash #

fn githash(path string) !string

githash returns the current seven-character Git commit hash for a checkout. It supports ordinary and linked worktrees, with loose or packed branch refs.

fn vhash #

fn vhash() string

vhash() returns the build string C.V_COMMIT_HASH . See cmd/tools/gen_vc.v .