Skip to main content

Module git

Module git 

Source
Expand description

Git integration utilities.

Helpers for interacting with git repositories — status, diff, log, blame, and branch operations. All operations shell out to the git CLI for maximum compatibility.

Structs§

DiffFile
A file in a parsed diff.
DiffHunk
A hunk within a diff file.
DiffLine
A single line in a diff hunk.

Enums§

DiffLineKind

Functions§

blame
Get blame for a file (abbreviated).
canonical_root
Resolve the canonical repository root, following worktree links.
current_branch
Get the current branch name.
default_branch
Get the default/main branch name.
diff
Get staged and unstaged diff.
diff_from_base
Get the diff between the current branch and the default branch.
is_git_repo
Check if the given directory is inside a git repository.
is_shallow
Check if the repository is a shallow clone.
is_worktree
Check if the current directory is inside a worktree (not the main checkout).
log
Get recent commit log.
parse_diff
Parse a unified diff into structured hunks.
repo_root
Get the root of the current git repository.
status
Get git status (short format).