Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
HEAD=$(git rev-parse --abbrev-ref HEAD)
if [[ "${HEAD}" == "HEAD" ]]; then
HEAD=$(git rev-parse HEAD)
fi
STASH=0
if [[ -n $(git status --porcelain) ]]; then
git stash
STASH=1
fi
trap "git checkout ${HEAD} && test ${STASH} -ne 1 || git stash pop" EXIT
readonly COMMITS=$(git log --pretty=oneline "${START}...${END}"| cut -d' ' -f1| tail -r)
for commit in ${COMMITS[@]}; do
git checkout $commit
./gradlew build -x test > "build${commit}" 2>&1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.