Skip to content

Commit

Permalink
Added a command to run a script against a sequence of commits.
Browse files Browse the repository at this point in the history
This is kind of like bisect, but when you want to hit every single
version.
  • Loading branch information
dustin committed Mar 30, 2009
1 parent e9c7301 commit 68306ec
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions git-test-sequence
@@ -0,0 +1,29 @@
#!/bin/sh
# Run a command over a sequence of builds.
# Example:
# git test-sequence origin/master.. 'make clean && make test'

start_branch=`git rev-parse --symbolic-full-name HEAD | sed s,refs/heads/,,`
tmpbranch=test_seq_$$

git checkout -b $tmpbranch

cleanup() {
git checkout $start_branch
git branch -D $tmpbranch
}

broke_on() {
echo "Broke on $v"
cleanup
exit 1
}

for v in `git rev-list --reverse $1`
do
git reset --hard $v && eval "$2" || broke_on $v
done

cleanup

echo "All's well."

0 comments on commit 68306ec

Please sign in to comment.