rlsbl v0.113.0 /rlsbl.changelog.resolve
On this page

Resolve abbreviated git commit hashes in changelog entries to full SHA-1 hashes and validate they exist in the repository.

#rlsbl.changelog.resolve

#rlsbl.changelog.resolve

Resolve abbreviated git commit hashes in changelog entries to full SHA-1 hashes and validate they exist in the repository.

#resolve_hash

python
def resolve_hash(hash_str: str, *, cwd: str | None=None) -> str | None

Resolve a (possibly abbreviated) commit hash to a full 40-char SHA.

cwd is the repository to resolve in; None means the process CWD (the historical behavior). Callers that may run from outside the target repo must pass it explicitly.

Returns None if the hash doesn't resolve in that repo.

#resolve_hashes

python
def resolve_hashes(hashes: list[str], *, cwd: str | None=None) -> dict[str, str | None]

Batch-resolve a list of commit hashes.

cwd is the repository to resolve in; None means the process CWD.

Returns a mapping from each input hash to its full 40-char SHA, or None if it doesn't resolve.

#_git_log_hashes

python
def _git_log_hashes(range_spec: str) -> list[str]

Get commit hashes from git log for a given range spec.

Returns a list of full 40-char SHAs, or empty list on error.

#_get_last_version_tag

python
def _get_last_version_tag(tag_glob: str | None=None, *, cwd=None) -> str | None

Resolve the last version tag, accepting None for tag_glob.

None means the plain v* glob (standalone repos); monorepo callers pass their project's glob. cwd selects the repository.

#_unreleased_range

python
def _unreleased_range(tag_glob: str | None=None, *, cwd=None) -> str

Return the git log range spec for unreleased commits.

Uses ..HEAD if a version tag exists, otherwise HEAD (all commits, for first release). Passes tag_glob and cwd through to _get_last_version_tag for monorepo-aware tag discovery.

Search