Expand description
Renders a git diff --stat/jj diff --stat-style summary from per-file line counts, for
sources that report changed files via their own API (Phabricator’s differential.querydiffs)
or only an aggregate count (GitHub’s PR object) rather than a local git/jj diff.
Structs§
- File
Change - One changed file’s line counts, as reported by a source’s API.
Functions§
- format_
diffstat - Render
changesthe waygit diff --statwould: onepath | 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 aN files changed, X insertions(+), Y deletions(-)summary line (always counting every file, shown or not). Returns an empty string for no changes. - format_
summary - Just the
N files changed, X insertions(+), Y deletions(-)line, for sources that only expose aggregate counts (GitHub’s PR object) rather than a per-file breakdown.