Expand description
Utility module for running Git commands.
This module provides helpers for interacting with a Git repository, primarily to extract metadata (commit hash, tag, timestamp, branch).
All functions return mdbook::errors::Error on failure so they can be
integrated directly into the mdbook preprocessor error flow.
See also:
get_git_output— Run arbitrary Git commands and capture output.verify_branch— Convenience wrapper to check branch existence.
Functions§
- get_
git_ output - Run a Git command and return the trimmed
stdoutoutput as aString. - latest_
tag_ for_ branch - Return the latest tag name, preferring tags reachable from the given branch’s HEAD. Falls back to global (by creator date) when describe fails. Returns “No tags found” if not tag found
- verify_
branch - Verify that a branch exists locally in the given repository.