Created
April 6, 2020 09:37
-
-
Save nrlozdemir/5125db680b6a1cfed7854d59d3b4ba9e 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 | |
#set -x | |
IFS=$'\n'; | |
objects=`git verify-pack -v .git/objects/pack/pack-*.idx | grep -Ev "non delta|chain length|git/objects" | tr -s " " | sort -k3gr | head -n30` | |
output="size,SHA,location" | |
for y in $objects | |
do | |
# extract the size in KB | |
size=$((`echo $y | cut -f 3 -d ' '`/1024)) | |
sha=`echo $y | cut -f 1 -d ' '` | |
other=`git rev-list --all --objects | grep $sha` | |
#lineBreak=`echo -e "\n"` | |
output="${output}\n${size},${other}" | |
done | |
echo -e $output | column -t -s ', ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment