function capture_profile { | |
git checkout --quiet --force $commit_sha | |
echo 'gem "rspec_profiling", group: [:development, :test]' >> Gemfile | |
bundle install --quiet | |
echo 'require "rspec_profiling/rspec"' >> spec/rails_helper.rb | |
rake db:test:prepare | |
rspec spec | |
} | |
function every_nth_commit { | |
git rev-list --no-merges master | | |
awk -v n="$1" 'NR == 1 || NR % n == 0' | |
} | |
every_nth_commit 10 | # Change 10 to whatever you're into | |
head -n 1 | | |
while read commit_sha; | |
do capture_profile | |
done``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment