summaryrefslogtreecommitdiffstats
path: root/scripts/branch-contains-no-tmp-commits
blob: 1a8a3891d5a0414730b3d82609f5e84fbb7b08ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/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"