This file looks large and may slow your browser down if we attempt
to syntax highlight it, so we are showing it without any
pretty colors.
Highlight
it anyway.
| 1 |
#!/bin/sh |
| 2 |
# Run a command over a sequence of builds. |
| 3 |
# Example: |
| 4 |
# git test-sequence origin/master.. 'make clean && make test' |
| 5 |
|
| 6 |
start_branch=`git rev-parse --symbolic-full-name HEAD | sed s,refs/heads/,,` |
| 7 |
tmpbranch=test_seq_$$ |
| 8 |
|
| 9 |
git checkout -b $tmpbranch |
| 10 |
|
| 11 |
cleanup() { |
| 12 |
git checkout $start_branch |
| 13 |
git branch -D $tmpbranch |
| 14 |
} |
| 15 |
|
| 16 |
broke_on() { |
| 17 |
echo "Broke on $v" |
| 18 |
cleanup |
| 19 |
exit 1 |
| 20 |
} |
| 21 |
|
| 22 |
for v in `git rev-list --reverse $1` |
| 23 |
do |
| 24 |
git reset --hard $v && eval "$2" || broke_on $v |
| 25 |
done |
| 26 |
|
| 27 |
cleanup |
| 28 |
|
| 29 |
echo "All's well." |