Skip to content

Commit

Permalink
[dev.boringcrypto] misc/boring: make merge.sh and release.sh a little…
Browse files Browse the repository at this point in the history
… more robust

Change-Id: Ie5f48a542889be5d5a15c16b6bd8ce19ee0f5bdd
Reviewed-on: https://go-review.googlesource.com/c/go/+/221277
Reviewed-by: Katie Hockman <katie@golang.org>
  • Loading branch information
FiloSottile committed Feb 28, 2020
1 parent 09bc5e8 commit 601da81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions misc/boring/merge.sh
Expand Up @@ -9,7 +9,6 @@ if [ "$#" -ne 2 ]; then
exit 1
fi

set -x
TARGET="$1"
SOURCE="$2"
WORKTREE="$(mktemp -d)"
Expand All @@ -20,11 +19,12 @@ git worktree add --track -b "$BRANCH" "$WORKTREE" "origin/$TARGET"

cd "$WORKTREE"
export GIT_GOFMT_HOOK=off
git merge -m "all: merge $SOURCE into $TARGET" "$SOURCE" || \
(git rm VERSION && git commit -m "all: merge $SOURCE into $TARGET")
git merge --no-commit "$SOURCE" || echo "Ignoring conflict..."
[[ -f VERSION ]] && git rm -f VERSION
git commit -m "all: merge $SOURCE into $TARGET"

if ! git log --format=%B -n 1 | grep "\[dev.boringcrypto"; then
echo "The commit does not seem to be targeting a BoringCrypto branch."
if ! git log --format=%B -n 1 | grep "\[$TARGET\] "; then
echo "The commit does not seem to be targeting the BoringCrypto branch."
exit 1
fi

Expand Down
4 changes: 3 additions & 1 deletion misc/boring/release.sh
Expand Up @@ -8,7 +8,9 @@ if [ "$#" -eq 0 ]; then
exit 1
fi

set -x
# Check that the Docker daemon is available.
docker ps > /dev/null

WORKTREE="$(mktemp -d)"
BRANCH="boring/release-$(date +%Y%m%d%H%M%S)"

Expand Down

0 comments on commit 601da81

Please sign in to comment.