commit-msg 430 B

123456789101112
  1. #!/usr/bin/env bash
  2. INPUT_FILE=$1
  3. START_LINE=${2:-`head -n1 $INPUT_FILE`}
  4. PATTERN="^(HUE\-[a-z0-9]+ \[.+\] .+)|(\[.+\] .+? \(#[a-z0-9]+\)|(Merge branch 'master' into .+))"
  5. if ! [[ "$START_LINE" =~ $PATTERN ]]; then
  6. echo "'$START_LINE' is not a valid commit message, please see for examples:"
  7. echo " HUE-9374 [impala] Use 26000 as default for thrift-over-http"
  8. echo " [livy] Add numExecutors options (#1238)"
  9. exit 1
  10. fi