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_
between_ in - Count how many commits touched each file since
since, optionally anchored with--until=<until>(anygit logdate spec). - churn_
since - Count how many commits touched each file since
since(agit log --sincedate spec, e.g."6 months ago"or"2025-01-01"). - head_
commit_ in - The current HEAD commit as
(full sha, committer date). - is_
dirty_ in - Whether the working tree has uncommitted changes (staged, unstaged, or
untracked), per
git status --porcelain. - 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.
- rev_
list_ first_ parent_ in - First-parent commit shas in
range(e.g.abc123..HEAD), oldest first. - 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.