xx
.md

git_semver_next

git_semver_next finds the highest valid semantic-version tag targeting a commit in the local repository, then parses commits reachable from HEAD but outside that tag's ancestry as Conventional Commits. It returns the version produced by the largest required bump:

CommitBump
Header with !, or BREAKING CHANGE:/BREAKING-CHANGE: footerMajor
feat: description or feat(scope): descriptionMinor
Any other valid conventional type, including fix, chore, and chorsPatch
Invalid commit messageNone

If no semantic-version tag exists, calculation starts at v0.0.0 and examines all commits reachable from HEAD. If no commit requires a bump, the latest version is returned unchanged. Tags may omit the v prefix; returned versions always include it.

This function only reads the local repository. It does not fetch tags or commits.

Arguments

ArgumentRequiredDescription
repositoryNoProject-relative Git repository directory. Defaults to ..
depsNoDependencies that must complete before reading history. Defaults to [].

Example

load("@git@1", "git_semver_next")

version = git_semver_next()