From 0bcab59d37c2fff90d0cd86b180bb74bf13777d2 Mon Sep 17 00:00:00 2001 From: Xiang Dai <764524258@qq.com> Date: Mon, 19 Aug 2019 11:01:50 +0800 Subject: [PATCH 1/2] add quota for sed Signed-off-by: Xiang Dai <764524258@qq.com> --- tools/image-tag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/image-tag b/tools/image-tag index cfa0aae7690d..6e2deb4f2c17 100755 --- a/tools/image-tag +++ b/tools/image-tag @@ -5,7 +5,7 @@ set -o nounset set -o pipefail WIP=$(git diff --quiet || echo '-WIP') -BRANCH=$(git rev-parse --abbrev-ref HEAD | sed s#/#-#g) +BRANCH=$(git rev-parse --abbrev-ref HEAD | sed 's#/#-#g') SHA=$(git rev-parse --short=7 HEAD | head -c7) # If this is a tag, use it, otherwise branch-hash From a39b154df00456e966d5fd663015eab0f2daf2d5 Mon Sep 17 00:00:00 2001 From: Xiang Dai <764524258@qq.com> Date: Mon, 19 Aug 2019 15:46:45 +0800 Subject: [PATCH 2/2] add comment for head Signed-off-by: Xiang Dai <764524258@qq.com> --- tools/image-tag | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/image-tag b/tools/image-tag index 6e2deb4f2c17..406b0740e0d7 100755 --- a/tools/image-tag +++ b/tools/image-tag @@ -6,6 +6,8 @@ set -o pipefail WIP=$(git diff --quiet || echo '-WIP') BRANCH=$(git rev-parse --abbrev-ref HEAD | sed 's#/#-#g') +# When 7 chars are not enough to be unique, git automatically uses more. +# We are forcing to 7 here, as we are doing for grafana/grafana as well. SHA=$(git rev-parse --short=7 HEAD | head -c7) # If this is a tag, use it, otherwise branch-hash