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.