]>
Tony Duckles's Git Repositories (git.nynim.org) - dotfiles.git/blob - bin/git-big-object-report
   2 # Shows you the largest objects in your repo's pack file. 
   3 # Originally written for OSX by Antony Stubbs. 
   4 # http://stubbisms.wordpress.com/2009/07/10/git 
   6 # POSIX compatibility by Ryan Tomayko <r@tomayko.com> 
   9 # set the internal field spereator to line break, so that we can 
  10 # iterate easily over the verify-pack output 
  13 git_dir
=$(git rev-parse --git-dir) 
  15 # list all objects including their size, sort by size, take top 10 
  17     git verify
-pack -v "$git_dir"/objects
/pack
/pack
-*.idx 
| 
  23 printf "%7s %7s %-7s %-20s\n" SIZE PACK SHA1 LOCATION
 
  26     size
=$((`echo $y | cut -f 5 -d ' '`/1024)) 
  27     pack_size
=$((`echo $y | cut -f 6 -d ' '`/1024)) 
  28     sha1
=$(echo $y | cut -f 1 -d ' ') 
  29     short
=$(echo "$sha1" |cut -c1-7) 
  30     path
=$(git rev-list --all --objects |grep $sha1 |cut -c42-) 
  32     printf "%7d %7d %-7s %-20s\n" "$size" "$pack_size" "$short" "$path" 
  35 echo "All sizes in KB. PACK = size of compressed object in pack file."