imag/scripts/branch-contains-no-tmp-commits

24 lines
694 B
Bash

#!/usr/bin/env bash
# Because travis _SUCKS_ really hard, we cannot find the "master" commit or any
# commit where the current branch is derived from (if this is not master).
# So we simply use HEAD~49..HEAD as the range to check. This might break some
# day, I don't know.
# But as travis only clones 50 commits and does not provide ANY usable
# information about the commits, this is the only thing we can do.
COMMIT_RANGE="HEAD~49..HEAD"
logfreeof() {
git log --format="%s" $COMMIT_RANGE |\
awk '{print $1}' |\
grep -i "$1" && echo "LOG CONTAINS '$1'" && exit 1
return 0
}
logfreeof "fixup"
logfreeof "squash"
logfreeof "wip"
logfreeof "tmp"
logfreeof "ci skip"