WYRD/TOOLS

Tools / tagver / Overview

Overview

tagver uses Git tags as the single source of truth for versions and calculates distance from the tagged commit to generate alpha versions. It is a single statically linked binary with no runtime dependencies.

It reads your Git history and computes a SemVer 2.0.0 version from the nearest tag plus commit height. Merge commits are handled cleanly via first-parent traversal, and output is available as JSON for scripting.

tagver is inspired by MinVer and built on the pure-Rust gitoxide Git implementation.

Features

FeatureWhat it gives you
Tag-driven versioningGit tags are the single source of truth
Height calculationCommit distance from the nearest tag generates alpha versions
Cross-platformOne binary, wherever Rust compiles
Zero dependenciesStatically linked, nothing to install at runtime
JSON outputMachine-readable version details for scripting
First-parent traversalMerge commits handled correctly
Strict SemVer 2.0.0Versions parse and render per the SemVer specification
GitHub ActionExposes the calculated version and components as workflow outputs

How it works

tagver walks your commit history and synthesizes a version:

  1. Tag discovery — find all Git tags matching the configured prefix.
  2. Version parsing — parse those tags as SemVer 2.0.0 versions.
  3. Commit traversal — walk from HEAD (first-parent) to the nearest tagged ancestor.
  4. Height calculation — count the commits between HEAD and that base tag.
  5. Version synthesis — if HEAD is exactly on a tag, use it as-is; otherwise apply the auto-increment policy, append the default pre-release identifiers and the height, honor any minimum major.minor constraint, and append build metadata if provided.

Example results

Git stateResult
On tag 1.0.01.0.0
5 commits after 1.0.01.0.1-alpha.0.5
On tag 1.0.0-beta.11.0.0-beta.1
3 commits after 1.0.0-beta.11.0.0-beta.1.3
No tags0.0.0-alpha.0
2 commits from root0.0.0-alpha.0.2