Last active
August 30, 2018 03:09
-
-
Save nfekete/29c8c8042e9f021c94cbbf0e76f5c15a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while [[ $# > 0 ]] ; do | |
case "$1" in | |
--not-in-head) | |
NOT_IN_HEAD=true | |
;; | |
esac | |
shift | |
done | |
git rev-list --objects --all \ | |
| \ | |
if [ -n "$NOT_IN_HEAD" ]; then | |
grep -vF --file=<(git ls-tree -r HEAD | awk '{print $3}') | |
else | |
cat | |
fi \ | |
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \ | |
| sed -n 's/^blob //p' \ | |
| sort --numeric-sort --key=2 \ | |
| cut -c 1-12,41- \ | |
| numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment