chore(ci): don't use git --no-merges for git commit message checking

When doing a short clone, like travis does, git can't tell if the
oldest commit is a merge of not. Just allow either commit message
format for all commits, and rely on reviewers and common sense to not
name normal commits "Merge.*"

Fix #6051
reviewable/pr6086/r1
Anthony Bilinski 2020-04-13 00:51:48 -07:00
parent c13ede85df
commit 40989e54d8
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
1 changed files with 4 additions and 5 deletions

View File

@ -36,11 +36,10 @@ ARG="$1"
echo "" # ← formatting
grep_for_invalid() {
# differentiate what is allowed for commit messages and merge messages
git log --no-merges --format=format:'%s' "$ARG" \
| grep -v -E '^(feat|fix|docs|style|refactor|perf|revert|test|chore)(\(.{,12}\))?:.{1,68}$' \
|| git log --merges --format=format:'%s' "$ARG" \
| grep -v -E '^Merge .{1,70}$'
# we can't rely on differentiating merge and normal commits since short clones that travis does may not be able
# to tell if the oldest commit is a merge commit or not
git log --format=format:'%s' "$ARG" \
| grep -v -E '^((feat|fix|docs|style|refactor|perf|revert|test|chore)(\(.{,12}\))?:.{1,68})|(Merge .{1,70})$'
}
# Conform, /OR ELSE/.