~matthiasbeyer/imag

ref: 9b48dc27cd00fcc75917c2702dc8dc4c6493e8d3 imag/scripts/branch-contains-no-tmp-commits -rw-r--r-- 694 bytes
9b48dc27Matthias Beyer libimagentryref: Move from error-chain to failure 3 years ago
                                                                                
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"