Skip to main content

format_diffstat

Function format_diffstat 

Source
pub fn format_diffstat(changes: &[FileChange]) -> String
Expand description

Render changes the way git diff --stat would: one path | N +++--- line per file (up to [MAX_FILES_SHOWN], widest bar capped at [MAX_BAR_WIDTH], +/- split proportionally to that file’s own additions/deletions), then a “N more files not shown” line if any were omitted, followed by a N files changed, X insertions(+), Y deletions(-) summary line (always counting every file, shown or not). Returns an empty string for no changes.