Expand description
Shared git helpers for quality commands.
All helpers shell out to git (matching the style of crate::diff) and
operate on the process working directory. Paths returned by these helpers
are relative to the working directory (the repo prefix is stripped), so
they line up with index-relative paths in .ctx/codebase.sqlite.
Functionsยง
- changed_
files_ against - Get the set of files changed relative to
reference. - changed_
files_ against_ in - Dir-explicit variant of
changed_files_against, for commands and tests that operate on an explicit project root instead of the process cwd. - churn_
since - Count how many commits touched each file since
since(agit log --sincedate spec, e.g."6 months ago"or"2025-01-01"). - is_
git_ repo - Check if the current directory is inside a git repository.
- is_
git_ repo_ in - Dir-explicit variant of
is_git_repo, for commands and tests that operate on an explicit project root instead of the process cwd. - repo_
prefix - Get the path of the current directory relative to the repository root.
- show_
file - Get the contents of
path(relative to the current directory) atreference, orNoneif the file does not exist at that revision. - show_
file_ in - Dir-explicit variant of
show_file, for commands and tests that operate on an explicit project root instead of the process cwd.