Subject: Re: [PATCH] pretty: add diff-stat log placeholders

From: Junio C Hamano <[email-masked]>
Date: Mon, 04 May 2026 14:09:47 +0900

"Andrey Zarubin via GitGitGadget" <[email-masked]> writes:

> From: Andrey Zarubin <[email-masked]>
>
> Currently, users who want per-commit line/file change counts in
> a custom log format must post-process `git log --shortstat`
> output because the pretty formatter exposes no equivalent
> placeholders.
>
> Introduce `%(diff-stat:files)`, `%(diff-stat:insertions)`,
> `%(diff-stat:deletions)`, and `%(diff-stat:lines)`, computed
> from the same diffstat machinery as `--shortstat` and cached
> once per commit during format expansion.
>
> Short aliases are provided as `%aF`, `%aA`, and `%aR`. The
> requested `%aI` and `%aD` forms are unavailable because those
> names already expand to author dates, so use additions/removals
> mnemonics instead.
>
> When log output is already walking a diff, the formatter reuses
> the current diff queue. Otherwise it computes a private summary
> lazily, so formats without these placeholders still pay no diff
> cost.
>
> Signed-off-by: Andrey Zarubin <[email-masked]>
> ---
>     pretty: add diff-stat log placeholders

Personally I find this a bit on the other side of the line between
sensible and insanity.  Will we next be adding a new placeholder to
show the summary (i.e. list of created, deleted, and renamed paths)
and another placeholder to show the entire patch text?