Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #!/bin/bash
  2. #set -x
  3.  
  4. IFS=$'\n';
  5.  
  6. # list all objects including their size, sort by size, take top 10
  7. objects=`git verify-pack -v .git/objects/pack/pack-*.idx | grep -v chain | sort -k3nr | head`
  8.  
  9. echo "All sizes are in kB. The pack column is the size of the object, compressed, inside the pack file."
  10.  
  11. output="size,pack,SHA,location"
  12. for y in $objects
  13. do
  14. # extract the size in bytes
  15. size=$((`echo $y | cut -f 5 -d ' '`/1024))
  16. # extract the compressed size in bytes
  17. compressedSize=$((`echo $y | cut -f 6 -d ' '`/1024))
  18. # extract the SHA
  19. sha=`echo $y | cut -f 1 -d ' '`
  20. # find the objects location in the repository tree
  21. other=`git rev-list --all --objects | grep $sha`
  22. #lineBreak=`echo -e "\n"`
  23. output="${output}\n${size},${compressedSize},${other}"
  24. done
  25.  
  26. echo -e $output | column -t -s ', '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement