Run bash script on every git commit

bash, git

Solution

Well for starters you can use `rev-list`

git rev-list HEAD

Problem

Out of curiosity, I would like to benchmark a project I have been working on for a while, to see how it's performance at various tasks has varied over time. This project is stored in a git repository. Fundamentally, it seems like the correct method is ``` for r in $(git log --pretty="format:%H"); do git checkout $r echo "$r\t$(./benchmark.sh)" >> results.txt done ``` This seems like a hack however (using porcelain for a plumbing task, for starters), and so I am wondering if there is a "preferred" method for this, such as (I wish) ``` git black_magic-run-on-all ./benchmark.sh > results.txt ``` It seems like a common enough task, which is why I expect something to exist for this.

Original source