Skip to main content

Module git_info

Module git_info 

Source
Expand description

Git repository information collection

This module provides utilities for collecting git metadata from the workspace, similar to OpenAI Codex PR #10145. It collects remote URLs, HEAD commit hash, and repository root path for inclusion in LLM request headers.

Structs§

GitInfo
Git repository information for a workspace

Functions§

collect_git_info
Collect all git information for a workspace.
get_git_remote_urls
Get git remote URLs for fetch remotes in the repository at the given path. Returns a BTreeMap mapping remote names to their fetch URLs.
get_git_remote_urls_async
Async variant of get_git_remote_urls. Runs the git subprocess on the blocking thread pool.
get_git_repo_root
Get the repository root path for the given working directory.
get_head_commit_hash
Get the HEAD commit hash (short form) for the repository at the given path.
get_head_commit_hash_async
Async variant of get_head_commit_hash. Runs the git subprocess on the blocking thread pool.
is_git_repo
Check if the given path is inside a git repository.