From: Junio C Hamano <gitster@pobox.com>
To: "Andrey Zarubin via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Andrey Zarubin <zarandr@gmail.com>
Subject: Re: [PATCH] pretty: add diff-stat log placeholders
Date: Mon, 04 May 2026 14:09:47 +0900 [thread overview]
Message-ID: <xmqqmryfpxpg.fsf@gitster.g> (raw)
In-Reply-To: <pull.2284.git.git.1777578903593.gitgitgadget@gmail.com> (Andrey Zarubin via GitGitGadget's message of "Thu, 30 Apr 2026 19:55:03 +0000")
"Andrey Zarubin via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Andrey Zarubin <zarandr@gmail.com>
>
> 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 <zarandr@gmail.com>
> ---
> 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?
next prev parent reply other threads:[~2026-05-04 5:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 19:55 [PATCH] pretty: add diff-stat log placeholders Andrey Zarubin via GitGitGadget
2026-05-04 5:09 ` Junio C Hamano [this message]
2026-05-04 21:00 ` Andrey Zarubin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqmryfpxpg.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=zarandr@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.