Committer identity (author + committer name/email) for the rare path
where a git invocation lands on a host with no user.email /
user.name configured — notably actions/checkout@v6, which does
NOT set committer identity for the workflow runner. Resolved once per
caller and threaded through to revert_commit_in so the CLI never
mutates the repo’s git config (env-only, scoped to the single spawn).
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 super::detect_git_info
(which delegates to git rev-parse --short).
Return remote branch short names that contain sha (e.g. master,
release/v1). The bump commit’s SHA is the deterministic anchor of
the tag, so deriving the push branch from it is race-immune to the
default branch moving between bump and rollback. Empty Vec when
the SHA is not on any remote branch (orphan / not-yet-pushed).
git log -1 --format=%s <sha> — return the subject line of a single
commit. Used to render the “non-bump commit subject” list when the
rollback safety check fires.
git log --format=%H%x1f%s <sha>..HEAD — return every (full_sha, subject)
pair in the range in one subprocess. Used by the rollback safety check so
classifying N intervening commits is a single git spawn rather than
1 + N (one rev-list plus one log -1 per commit).
--name-only sibling of get_commits_between_paths_in: each commit is
paired with the repo-relative paths it touched, for a precise
changelog.paths glob intersect over the git-pathspec scope.
All commits reachable from an arbitrary rev (not just HEAD), filtered to
paths. Used by the changelog stage to bound a no-lower-bound range at an
explicit upper ref (changelog ..<tag>): the range is then every ancestor
of <tag>, excluding commits made after it.
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.
Return true when name looks like a branch (NOT an anodize-shaped
release tag). Tag shapes: ^v\d+\.\d+\.\d+ (lockstep
v1.2.3[-pre][+build]) or ^<crate>-v\d+\.\d+\.\d+
(per-crate mycrate-v1.2.3[...]).
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”.
Process-env wrapper of resolve_github_token_with_env for call sites
without a Context (e.g. the bump/tag changelog-sync write path,
whose commands expose no --token flag).
Resolve the GitHub token for API calls through the codebase-standard
chain: explicit value (CLI flag / context option) → ANODIZER_GITHUB_TOKEN
→ GITHUB_TOKEN. Empty strings count as absent at every link — GitHub
Actions materializes missing secrets as "", which must not
short-circuit the fallback to the next link.
Resolve the committer identity to use for a rollback-style commit.
When the host already has user.name AND user.email configured
(or GIT_AUTHOR_* / GIT_COMMITTER_* are set in the parent env),
returns an empty identity so the child inherits the existing
values. Otherwise returns a synthetic identity so the commit
doesn’t fail with “Author identity unknown” on bare-CI hosts.
git rev-parse --verify <rev>^{commit} — resolve rev to a commit SHA,
erroring when it does not name an existing commit. Stricter than
rev_parse_in: --verify rejects ambiguous / non-existent refs (rather
than echoing the input back), and the ^{commit} peel rejects a ref that
resolves to a non-commit object (e.g. a tree or blob SHA).
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.