Skip to content

Instantly share code, notes, and snippets.

@heim
Created September 11, 2012 19:17
Show Gist options
  • Save heim/3701173 to your computer and use it in GitHub Desktop.
Save heim/3701173 to your computer and use it in GitHub Desktop.
repo-size.sh
#!/bin/bash
set -e
function main() {
git rev-list --reverse --since="6 months ago" HEAD |
while read rev; do
echo "`revision_time`, `line_count`"
done
}
function line_count() {
git ls-tree -r $rev |
awk '{print $3}' |
xargs git show |
wc -l
}
function revision_time() {
git log -1 $rev --pretty=format:"%ai"
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment