4

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.

5
  • See git hooks (man githooks) -> kernel.org/pub/software/scm/git/docs/githooks.html - Using these you can run scripts at various places in the SCM logic Commented Apr 25, 2013 at 21:20
  • Quite interesting, but not what I'm looking for in this case. This is a "I have two years of history, and I want to make a graph out of it" issue. I don't have a need to do this synchronously. Commented Apr 25, 2013 at 21:21
  • git bisect run might be something similar, but meant for another situation. Commented Apr 25, 2013 at 21:24
  • Ohhh, apologies @zebediah49 maybe you'll find a use for git hooks some other day ;-) Commented Apr 25, 2013 at 21:25
  • @Ron-Dahlgren Oh, totally agree.. even the obvious "make sure it compiles without error" test is a wonderful option. Commented Apr 25, 2013 at 21:26

1 Answer 1

3

Well for starters you can use rev-list

git rev-list HEAD
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.