It is important for me to know how 'heavy' commits are (way more then commit hash i.e.). Would be nice to have a setting/hook for that (or how can I hack it myself?).
It's not clear to me which buffer you want to see this information in.
magit-revision-mode buffers already show this information in the
diffstat section, which consists of a summary line like "1 file
changed, 2 insertions(+), 1 deletion(-)" as well as a breakdown of the
number of changes per file.
But I'm guessing you're asking about adding it to the log buffer. The
log popup contains a --diffstat switch that will tack the diffstat
onto the log. If you instead want only the overall summary line, you
could add --shortstat to the log popup with
magit-define-popup-switch.
My guess is that @xged would like to see this
548ded19 * origin/fix-3034 fix-3034 magit-abbrev-length: handle special case
13352f1e * master origin/master Fix another magit-version/symlink failure
047a2386 * Restore horizontal lines in README.md
5333ac79 * Add switch to toggle passing -f to `git remote add`
e8b382f0 * magit-git-wash: correct documentation of washer call
replaced with
1f, 7+,4- * origin/fix-3034 fix-3034 magit-abbrev-length: handle special case
1f, 2+,2- * master origin/master Fix another magit-version/symlink failure
1f, 3+,3- * Restore horizontal lines in README.md
2f,14+,4- * Add switch to toggle passing -f to `git remote add`
3f, 3+,3- * magit-git-wash: correct documentation of washer call
That might be nice in some cases. Also much more work to get it right (alignment, performance, looks, how to enable in ui...) than one might expect. I'll leave this open as something to consider eventually.
I have just pushed an initial version of this to master. It's not a very good implementation because it has performance issues, but I think it's useful never-the-less, as long as users are aware that it does impact performance.
Add a shortstat margin style for logs
The current implementation is problematic as it requires git to be
called once per commit, but doing it properly would have required
changes to highly problematic parts of existing code. Eventually
those things will get refactored at which point this new feature
will get a performance boost too.
To add the command to the relevant popups use:
(magit-define-popup-action 'magit-log-mode-refresh-popup
?x "toggle shortstat" 'magit-toggle-log-margin-style)
(magit-define-popup-action 'magit-log-refresh-popup
?x "toggle shortstat" 'magit-toggle-log-margin-style)
@tarsius It did not not work for me.
It appears "details" have to be switched on before switching to the shortstat style. I'll look into making that unnecessary.
Most helpful comment
My guess is that @xged would like to see this
replaced with
That might be nice in some cases. Also much more work to get it right (alignment, performance, looks, how to enable in ui...) than one might expect. I'll leave this open as something to consider eventually.