summaryrefslogtreecommitdiff
path: root/Omni/Ide/hooks/commit-msg
blob: c6197f90a6b3a19134b042c96983db5ec9e60506 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env bash
temp=$(mktemp)
# strip everything after >8 cut line, then strip comment lines
sed '/.*>8.*/,$d; /^#/d' "$1" | fmt -w 72 -u > "$temp"
mv "$temp" "$1"
if ! gitlint --ignore-stdin --staged --msg-filename "$1" run-hook; then
  backup="$CODEROOT"/.git/COMMIT_EDITMSG.backup
  cp "$1" "$backup"
  echo "error:  gitlint failed, saved your commit msg as $backup"
  exit 1
fi