Is there a command that will let me checkout a commit based on its distance from the current commit instead of using commit IDs?
Use Case
Basically I am thinking of setting up a cron job type script to do the following on a build server:
- Pull down the latest of a specific git branch (git pull dev).
- Build it, run the tests.
- If the pass percentage is lower than the last stored percentage:
- Recursively go back a commit, build, run tests, until it finds the commit where the percentage changed.
- Log the commits that introduced regressions.
I have a rough idea for how this would hinge together but it won't work unless I can go back one commit periodically.
If there is no specific command I suppose I could grep the commit log and take the first one each time?
I appreciate any ideas or help!
Unlike: How to undo last commit(s) in Git?
I want to go back "N" number of commits.