Skip to main content

extract_commit_churn

Function extract_commit_churn 

Source
pub fn extract_commit_churn(sha: &str) -> Result<Vec<FileChurn>>
Expand description

Extract commit churn (lines added/deleted per file)

Uses git show --numstat <sha> to get churn data for all files in the commit. Binary files (shown as -\t-\t<file>) are skipped.

§Arguments

  • sha - Commit SHA to analyze

§Returns

Returns vector of FileChurn entries, one per changed file. Returns empty vector for:

  • Initial commits (no parent)
  • Merge commits (uses first parent only)
  • Commits with no file changes

§Errors

Returns error if git command fails or output cannot be parsed