-
-
Save BenEddy/7df12b3308a6a8dfc057 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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