Skip to main content

Module changed_files

Module changed_files 

Source
Expand description

Changed-file helpers exposed through the engine boundary for editor and embedding surfaces.

Enums§

ChangedFilesError
Classification of a git diff failure, so callers can pick their own wording (soft warning vs hard error) without re-parsing stderr.

Functions§

filter_duplication_by_changed_files
Filter a duplication report to only retain clone groups where at least one instance belongs to a changed file. Families, mirrored directories, and stats are rebuilt from the surviving groups so consumers see consistent, correctly-scoped numbers.
filter_results_by_changed_files
Filter results to only include issues whose source file is in changed_files.
get_changed_files
Get files changed since a git ref. Returns None on git failure after printing a warning to stderr. Used by --changed-since and --file, where a failure falls back to full-scope analysis.
resolve_git_common_dir
Resolve the canonical git common directory for cwd.
resolve_git_toplevel
Resolve the canonical git toplevel for cwd.
set_spawn_hook
Install a spawn-hook for this module’s git subprocesses. Idempotent; subsequent calls are no-ops. Called once from the CLI’s main() so long-running watch sessions reap pending git children on Ctrl+C. Defaults to Command::output when not set; the function-pointer indirection costs nothing for embedders and tests that don’t install a hook.
try_get_changed_diff
Get the zero-context unified diff of the merge-base range git_ref...HEAD, with paths relative to root, for the line-level security gate (issue #886).
try_get_changed_files
Get files changed since a git ref. Returns Err (with details) when the git invocation itself failed, so callers can choose between warn-and-ignore and hard-error behavior.
try_get_changed_files_with_toplevel
Like try_get_changed_files, but takes a pre-resolved canonical toplevel so callers (the LSP) can cache it across runs and avoid the extra git rev-parse --show-toplevel subprocess on every save.
validate_git_ref
Validate a user-supplied git ref before passing it to git diff.