diff --git a/image-tag b/image-tag new file mode 100755 index 0000000000..edee359306 --- /dev/null +++ b/image-tag @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -o errexit +set -o nounset +set -o pipefail + +WORKING_SUFFIX=$(if ! git diff --exit-code --quiet HEAD >&2; \ + then echo "-WIP"; \ + else echo ""; \ + fi) +BRANCH_PREFIX=$(git rev-parse --abbrev-ref HEAD) +echo "${BRANCH_PREFIX//\//-}-$(git rev-parse --short HEAD)$WORKING_SUFFIX"