Skip to content

Instantly share code, notes, and snippets.

@danpoltawski
Created November 11, 2016 17:54
Show Gist options
  • Save danpoltawski/d06776b878a0c54fe91599227a5f8468 to your computer and use it in GitHub Desktop.
Save danpoltawski/d06776b878a0c54fe91599227a5f8468 to your computer and use it in GitHub Desktop.
#!/bin/bash
STARTDAY=20160102
echo "Week beginning, fileschanged, insertions, deletion"
for i in $(seq 0 44); do
from=$(date +%Y-%m-%d --date $STARTDAY+${i}weeks)
j=$(($i+1))
to=$(date +%Y-%m-%d --date $STARTDAY+${j}weeks)
fromcommit=$(git rev-list -n 1 --before=$from master)
tocommit=$(git rev-list -n 1 --before=$to master)
echo -n "$from, "
git diff --shortstat $fromcommit..$tocommit | sed 's/\([0-9]*\) files changed, \([0-9]*\) insertions(+), \([0-9]*\) deletions(-)/\1, \2, \3 /'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment