Skip to content

Commit

Permalink
Script to show file size changes in git history
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Petersen committed Jun 16, 2015
1 parent dcf28e7 commit d096dad
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions git-file-size-diff
@@ -0,0 +1,22 @@
#!/bin/sh
. git sh-setup
args=$(git rev-parse --sq "$@")
eval "git diff-tree -r $args" | {
total=0
while read A B C D M P
do
case $M in
M) bytes=$(( $(git cat-file -s $D) - $(git cat-file -s $C) )) ;;
A) bytes=$(git cat-file -s $D) ;;
D) bytes=-$(git cat-file -s $C) ;;
*)
echo >&2 warning: unhandled mode $M in \"$A $B $C $D $M $P\"
continue
;;
esac
total=$(( $total + $bytes ))
printf '%d\t%s\n' $bytes "$P"
done
echo total $total Bytes
echo total $(($total/1000)) KBytes
}

0 comments on commit d096dad

Please sign in to comment.