Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sort git diff --stat starting from the files that have most lines changed
git show HEAD --stat=200 | tail +7 | awk '{ print $3 " "$4 " " $1}' | sort -n -r | less
5430 +++++++++++++++++++++++++++++++++++++++++++-------------------------------------------- src/aria/utils/SynEvents.j
3566 ++++++++++++++++++++++++++++----------------------------- src/aria/utils/Date.js
3182 +++++++++++++++++++++++++-------------------------- src/aria/Aria.js
2276 ++++++++++++++++++------------------- src/aria/templates/CfgBeans.js
1764 ++++++++++++++-------------- src/aria/core/JsObject.js
1204 ++++++++++---------- src/aria/templates/Repeater.js
998 ++++++++-------- src/aria/core/Interfaces.js
972 ++++++++-------- src/aria/templates/ClassWriter.js
846 +++++++------- test/aria/utils/DeviceTest.js
764 ++++++------- src/aria/core/Log.js
752 ++++++------ src/aria/templates/Modifiers.js
738 ++++++------ src/aria/templates/Layout.js
698 ++++++------ src/aria/tester/runner/ModuleController.js
634 +++++------ src/aria/utils/FrameATLoader.js
556 ++++----- src/aria/widgets/frames/TableFrame.js
474 ++++---- src/aria/utils/DomOverlay.js
474 ++++---- src/aria/core/ResClassLoader.js
454 ++++---- src/aria/utils/Device.js
..
1 - build/README.md
changed, 18963 1025
@rcdailey

This comment has been minimized.

Copy link

@rcdailey rcdailey commented Oct 17, 2018

Needs improvements:

  1. Needs color (e.g. same coloring as in diff --stat)
  2. File names need to be aligned on the same column, which requires the width of the diffstat graph on the left to be fixed.
@milo-minderbinder

This comment has been minimized.

Copy link

@milo-minderbinder milo-minderbinder commented Jan 3, 2020

@rcdaily, I agree! This should do the trick: https://gist.github.com/milo-minderbinder/28d8a81bf2335dc51bec36cd24394c8f

*edit for the lazy:
git diff --stat --stat-width "$(tput cols)" --color=always | sort -k3 "$@"
or, even better, as a git alias:
git config --global alias.diff-stat-sort '!git diff --stat --stat-width "$(tput cols)" --color=always | sort -k3'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.