Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add diffstat on magit-commit-mode and magit-diff-mode #511

merged 4 commits into from Apr 2, 2013


None yet
3 participants

cinsk commented Nov 28, 2012

When a commit has lots of files, it would be difficult to get the overview of the commit, although we can control the output of the magit-commit and magit-diff buffer by using magit-show-level-1 and so on.

This branch will includes support for git log --stat and git diff --patch-with-stat commands. so the either commit log or diff log will contains section like:

7 files changed, 87 insertions(+), 136 deletions(-)
 pom.xml                                         |    9 +--
 src/main/java/com/mycompany/rest/Follow.java    |    6 -
 src/main/java/com/mycompany/rest/Pins.java      |  107 +++++++++-----------
 src/main/java/com/mycompany/rest/Upload.java    |   11 +--
 .../java/com/mycompany/rest/UserBoards.java     |   54 ++++------
 src/main/java/com/mycompany/rest/UserPins.java  |    6 -
 src/main/java/com/mycompany/rest/Users.java     |   30 ++----
  • Section nagivation commands works properly (e.g. p, n',M-p,M-n`, etc.)
  • RET will visit the file using magit-visit-item,
  • e will invoke magit-ediff.
  • M-g will move points to the diffstat headers.

There is minor problem (on restoring window-configuration); when the user press e at the diffstat line, the code will move the point to the actual diff section line, and will invoke magit-ediff. When the user quit ediff, the point is at the actual diff section line, not the diffstat line.

Tested on

cinsk added some commits Nov 24, 2012

add diffstat section on `git log` and `git diff`.
log and diff related functions will display *diffstat* if `magit-show-diffstat` is non-nil.

On *diffstat* entry, `e` will launch `magit-ediff`.  However, the window configuration will not be restored properly yet.
fix a bug that can't handle abbreviated filename in diffstat
- better washing mechanism for diffstat sections

lelit commented Apr 2, 2013

This would be very handy: I still use egg-commit just because it shows me one final overview of what is going on, plus a chance of directly re-adjust the staged stuff...

@sigma sigma merged commit 3ac696b into magit:master Apr 2, 2013

1 check passed

default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment