Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/skade

.nornir/version-githash-guide.md

Version + git-hash stamp

Per the nordisk version LAW, the skade-katalog serve binary reports both its semantic version and the exact commit it was built from.

Surface

$ skade-katalog --version      # also: -V
skade v0.1.16 (2e677cb3b3b1)

The line is skade v<version> (<git-hash>) where:

How the hash is derived (zero-shell)

serve/build.rs reads the commit id straight out of .git/ — it never shells out to git, honoring the zero-shelling law. It:

  1. walks up from CARGO_MANIFEST_DIR to find .git (a directory, or a gitdir: pointer file for a linked worktree/submodule, resolved via commondir);
  2. reads .git/HEAD — a symbolic ref: refs/heads/<b> is resolved via the loose ref file, falling back to packed-refs; a detached HEAD uses its raw id;
  3. emits cargo:rustc-env=SKADE_GIT_HASH=<short-sha> plus rerun-if-changed on every file it reads, so the stamp refreshes on each new commit.

When no repository is present (e.g. a cargo publish tarball build) it falls back to unknown rather than failing the build. The core crate's published tarball stays pristine: the build.rs and the stamp live only in the detached serve/ workspace; the core crate exposes just the plain VERSION const.