Last active
April 27, 2017 11:31
-
-
Save zeroem/6822534 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
COMMITS=$(git log --oneline | cut -d " " -f 1) | |
for COMMIT in $COMMITS | |
do | |
git checkout $COMMIT | |
./path/to/script.sh | |
if [ $? -eq 0 ] | |
then | |
echo $COMMIT passed | |
else | |
echo $COMMIT failed | |
fi | |
done | |
git checkout master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
./path/to/script can be an absolute path or relative to the current working directory (pwd). $? holds the exit code of the last executed command. So assuming your script exits with a non-zero exit code on failure, the rest will just work.