Skip to content

Instantly share code, notes, and snippets.

@ctubbsii
Created November 25, 2015 20:31
Show Gist options
  • Save ctubbsii/48a4e7c8e6bf39f7e83f to your computer and use it in GitHub Desktop.
Save ctubbsii/48a4e7c8e6bf39f7e83f to your computer and use it in GitHub Desktop.
A small script to find which file in a commit broke the maven build
for x in $(git diff --name-status $(git merge-base master HEAD) | arg2); do
echo $x
git clean -fdx > /dev/null && \
git checkout $(git merge-base master HEAD) -- $x && \
(mvn clean verify 2>&1 | tee ../log-$(echo $x | tr / _).txt > ../log-current.txt; [[ ${PIPESTATUS[0]} == 0 ]]) && \
echo SUCCESS && \
break || \
echo FAILURE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment