Open xzfc opened 1 month ago
I think this only needs a diff().stat()
method and optionally the --shortstat
option although you could achieve it also via template then.
The diff().stat()
output is not concise, it lists every file affected.
Then it should have a way of providing a conciser output either via parameter or some other option.
We'll need something like diff.files().len()
, diff.line_stat().added()
/.removed()
. If we don't care the formatting, diff.stat().last_line()
(i.e. add template.last_line()
method) will also work.
Is your feature request related to a problem? Please describe.
The
git log
command has a--shortstat
option. It gives a quick overview of how "heavy" a particular commit is and allows a user to visually filter out heavy commits at a glance to thelog
output. I use it as a signal whether it is time to split current feature branch into multiple PRs.I want something similar for
jj log
.Describe the solution you'd like
Given that after d1912bf0 ("templater: add commit.diff().\() methods") we have
TreeDiff
exposed to the templates, I think this use-case could be covered by exposing changed files/additions/deletions out of it. Thus, a user-configuredlog
template could produce something like this:Describe alternatives you've considered
Provide a
--shortstat
option forjj log
just likegit log
does.