Skip to content

Instantly share code, notes, and snippets.

@foolip
Last active October 17, 2017 09:42
Show Gist options
  • Save foolip/c763fd670515da8855f0d837714c770f to your computer and use it in GitHub Desktop.
Save foolip/c763fd670515da8855f0d837714c770f to your computer and use it in GitHub Desktop.
Also count servo exports
#!/bin/bash -e
for month in {2015,2016,2017}-{01,02,03,04,05,06,07,08,09,10,11,12}; do
# GNU date
nextmonth=`date +%Y-%m -d "$month-01 +1 month"`
# BSD date
#nextmonth=`date -j -f %Y-%m-%d -v+1m "$month-01" +%Y-%m`
commits=`git rev-list origin/master --no-merges --since $month-01T00:00:00Z --until $nextmonth-01T00:00:00Z --count`
chromium_exports=`git rev-list origin/master --no-merges --since $month-01T00:00:00Z --until $nextmonth-01T00:00:00Z --count --grep "^Change-Id:" --grep "^Cr-Commit-Position:"`
gecko_exports=`git rev-list origin/master --no-merges --since $month-01T00:00:00Z --until $nextmonth-01T00:00:00Z --count --grep "^Upstreamed from https://bugzilla\\.mozilla\\.org/"`
servo_exports=`git rev-list origin/master --no-merges --since $month-01T00:00:00Z --until $nextmonth-01T00:00:00Z --count --grep "^Upstreamed from https://github\\.com/servo/"`
echo -e "$month\t$commits\t$chromium_exports\t$gecko_exports\t$servo_exports"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment