Skip to main content

Module git

Module git 

Source
Expand description

Git repository utilities for branch tracking

This module provides helper functions for interacting with git repositories to track branch state, detect uncommitted changes, and capture git metadata for branch-aware indexing.

Structs§

GitState
Git repository state
WorktreeChanges
Files that differ between the working tree and the last commit.

Constants§

MAX_REPORTED_PATHS
How many paths per category a WorktreeChanges will name.

Functions§

changed_paths
Every path git status lists, uncapped and unfiltered.
diff_names
Paths that differ between two commits (git diff --name-only).
get_current_branch
Get the current git branch name
get_current_commit
Get the current commit SHA
get_git_state
Get complete git state for the current repository
get_git_state_optional
Get git state, or return None if not in a git repository
get_worktree_changes
List working-tree changes against HEAD.
has_uncommitted_changes
Check if there are uncommitted changes in the working tree
is_git_available
Check whether the git binary is available on PATH.
is_git_repo
Check if the current directory is inside a git repository
is_ignored
Whether git check-ignore says path (workspace-relative) is ignored.
read_head_branch
The current branch, read from .git/HEAD without spawning git.