pub struct ChangeHistory { /* private fields */ }Expand description
Aggregated change history for a codebase.
Stores changes indexed by file path and commit for efficient lookup. Does not require git integration at runtime; data can be pre-populated from any source (git, manual, tests).
Implementations§
Source§impl ChangeHistory
impl ChangeHistory
Sourcepub fn add_change(&mut self, change: FileChange)
pub fn add_change(&mut self, change: FileChange)
Add a change to the history.
The change is indexed by its path and commit ID, and appended to the chronological list.
Sourcepub fn changes_for_path(&self, path: &Path) -> &[FileChange]
pub fn changes_for_path(&self, path: &Path) -> &[FileChange]
Get all changes for a given file path.
Sourcepub fn files_in_commit(&self, commit_id: &str) -> &[FileChange]
pub fn files_in_commit(&self, commit_id: &str) -> &[FileChange]
Get all files changed in a given commit.
Sourcepub fn change_count(&self, path: &Path) -> usize
pub fn change_count(&self, path: &Path) -> usize
Get the total number of changes recorded for a path.
Sourcepub fn bugfix_count(&self, path: &Path) -> usize
pub fn bugfix_count(&self, path: &Path) -> usize
Get the number of bugfix changes for a path.
Sourcepub fn all_commits(&self) -> Vec<&str>
pub fn all_commits(&self) -> Vec<&str>
Get all unique commit IDs.
Sourcepub fn chronological(&self) -> &[FileChange]
pub fn chronological(&self) -> &[FileChange]
Get all changes in chronological order.
Get unique authors for a path.
Sourcepub fn total_churn(&self, path: &Path) -> u64
pub fn total_churn(&self, path: &Path) -> u64
Get total churn (lines added + deleted) for a path.
Sourcepub fn total_changes(&self) -> usize
pub fn total_changes(&self) -> usize
Get the total number of changes across all files.
Sourcepub fn total_commits(&self) -> usize
pub fn total_commits(&self) -> usize
Get the total number of unique commits.
Sourcepub fn latest_timestamp(&self, path: &Path) -> u64
pub fn latest_timestamp(&self, path: &Path) -> u64
Get the most recent change timestamp for a path, or 0 if none.
Sourcepub fn oldest_timestamp(&self, path: &Path) -> u64
pub fn oldest_timestamp(&self, path: &Path) -> u64
Get the oldest change timestamp for a path, or 0 if none.
Trait Implementations§
Source§impl Clone for ChangeHistory
impl Clone for ChangeHistory
Source§fn clone(&self) -> ChangeHistory
fn clone(&self) -> ChangeHistory
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more