Default short-commit length used across error messages, log
output, and any place that needs to truncate a full SHA for
human display. Matches git’s --short default (7) — and the
ShortCommit template var populated by [git::detect_git_info]
(which delegates to git rev-parse --short).
git -C <repo> rev-parse HEAD — return HEAD’s full commit hash for the
given repository (or worktree). Path-taking sibling of
get_head_commit so callers (the determinism harness, future CI
glue) can resolve HEAD without cd-ing into the repo first.
git -C <repo> log -1 --format=%ct HEAD — return HEAD’s committer
timestamp (seconds since UNIX epoch) for the given repository. Used by
the determinism harness as the non-snapshot SDE seed.
git -C <workspace_root> tag --list --sort=-v:refname '<prefix>*' —
return the list of refs whose name starts with prefix, ordered by
reverse semver. Returns Ok(Vec::new()) when git fails (no repo,
no tags) so callers can treat absence as a non-error.
git -C <workspace_root> -c log.showSignature=false log --pretty=format:%B%x1e <range> -- <rel_path> — list commit message
bodies (subject+body) for commits in range touching rel_path,
using the \x1e (RS) byte as a between-commits separator so multi-line
bodies survive parsing.
git diff --name-only <tag>..HEAD -- <paths>... — return true when
any of the named paths changed between tag and HEAD. Returns
Ok(false) when git fails (e.g. not a git repo) so callers can treat
the absence-of-info case as “no changes”.
Truncate a full commit SHA string to SHORT_COMMIT_LEN
characters. Returns the input unchanged when it’s already shorter
or equal in length. Use this any time the SHA arrives as a string
(e.g. deserialized from a manifest or read from a template var)
rather than running git rev-parse --short again — saves a
subprocess and keeps the length convention in one place.