commit-msg 601 B

12345678910111213141516
  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 .+))|(Revert \".+?\")"
  5. if ! [[ "$START_LINE" =~ $PATTERN ]]; then
  6. echo "'$START_LINE' is not a valid commit message, please see for examples:"
  7. echo ""
  8. echo " [hive] Add numExecutors options"
  9. echo " [hive] Add numExecutors options (#1000)"
  10. echo " HUE-9999 [hive] Use 26000 as default for thrift-over-http"
  11. echo ""
  12. echo " Examples of labels: [hive], [impala], [phoenix], [ui], [k8s], [docs], [api]..."
  13. exit 1
  14. fi