[tools] First step of simplifying commit messages
INPUT_FILE=$1
START_LINE=${2:-`head -n1 $INPUT_FILE`}
-PATTERN="^(HUE\-[a-z0-9]+ \[.+\] .+)|(\[.+\] .+? \(#[a-z0-9]+\)|(Merge branch 'master' into .+))|(Revert \".+?\")"
+PATTERN="^(HUE\-[a-z0-9]+ \[.+\] .+)|(\[.+\] .+?( \(#[a-z0-9]+\))?|(Merge branch 'master' into .+))|(Revert \".+?\")"
if ! [[ "$START_LINE" =~ $PATTERN ]]; then
echo "'$START_LINE' is not a valid commit message, please see for examples:"
- echo " HUE-9374 [impala] Use 26000 as default for thrift-over-http"
- echo " [livy] Add numExecutors options (#1238)"
+ echo ""
+ echo " [hive] Add numExecutors options"
+ echo " [hive] Add numExecutors options (#1000)"
+ echo " HUE-9999 [hive] Use 26000 as default for thrift-over-http"
+ echo ""
+ echo " Examples of labels: [hive], [impala], [phoenix], [ui], [k8s], [docs], [api]..."
exit 1
fi
