simplebench.vcs module🔗

Version Control System utilities using Dulwich.

class simplebench.vcs.GitInfo(commit: str, date: str, dirty: bool)[source]🔗

Bases: object

Dataclass to hold Git repository information.

commit🔗

The current commit hash.

Type:

str

date🔗

The date of the current commit in ISO format.

Type:

str

dirty🔗

Whether there are uncommitted changes in the working directory.

Type:

bool

commit: str🔗
date: str🔗
dirty: bool🔗
to_dict() dict[str, Any][source]🔗

Convert to dictionary for JSON serialization.

simplebench.vcs.get_git_info(
search_path: Path | None = None,
) GitInfo | None[source]🔗

Fetch Git repository information using Dulwich.

Parameters:

search_path (Path | None) – The path to start searching for the git repository. If None, defaults to the directory of the main script or the current working directory.

Returns:

A dictionary with git info, or None if not a git repository.

Return type:

dict[str, Any] | None