Skip to content

Instantly share code, notes, and snippets.

@benjaminplee
Created December 19, 2011 14:39
Show Gist options
  • Save benjaminplee/1497489 to your computer and use it in GitHub Desktop.
Save benjaminplee/1497489 to your computer and use it in GitHub Desktop.
git commit mining scripts
git log --shortstat --format=format:"%cd" --date=short --no-merges | sed -e '/^$/d;N;s/\n//;s/files changed, //;s/insertions(+), //;s/ deletions(-)//'
just delta info:
git log --shortstat --format=format:"" --no-merges --all | sed '/^$/d;s/[a-z()+,-]//g'
git log --format=format:"%cd" --date=short --no-merges --all | wc -l
num commits total
git log --format=format:"%cd" --date=short --no-merges --all | uniq -c
num commits for each day
git log --format=format:"%cd" --date=short --no-merges --all | uniq -c | awk '{ total += $1; count++ } END { print total/count }'
avg commits per day
git log --format=format:"%cd" --no-merges --all | tr ':' ' ' | awk '{print $4}' | sort | uniq -c
num commits in each 24 hour slot
git log --format=format:"%cd" --no-merges --all | awk '{print $1}' | sort | uniq -c
num commits by day of the week
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment