mirror of
https://github.com/golang/go
synced 2024-11-23 05:30:07 -07:00
601da81916
Change-Id: Ie5f48a542889be5d5a15c16b6bd8ce19ee0f5bdd Reviewed-on: https://go-review.googlesource.com/c/go/+/221277 Reviewed-by: Katie Hockman <katie@golang.org>
33 lines
891 B
Bash
Executable File
33 lines
891 B
Bash
Executable File
#! /bin/bash
|
|
set -euo pipefail
|
|
|
|
if [ "$#" -ne 2 ]; then
|
|
echo "usage: merge.sh <target branch> <source revision>"
|
|
echo ""
|
|
echo "example: merge.sh dev.boringcrypto master"
|
|
echo " merge.sh dev.boringcrypto.go1.10 go1.10.7"
|
|
exit 1
|
|
fi
|
|
|
|
TARGET="$1"
|
|
SOURCE="$2"
|
|
WORKTREE="$(mktemp -d)"
|
|
BRANCH="boring/merge-$TARGET-$(date +%Y%m%d%H%M%S)"
|
|
|
|
git fetch
|
|
git worktree add --track -b "$BRANCH" "$WORKTREE" "origin/$TARGET"
|
|
|
|
cd "$WORKTREE"
|
|
export GIT_GOFMT_HOOK=off
|
|
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 "\[$TARGET\] "; then
|
|
echo "The commit does not seem to be targeting the BoringCrypto branch."
|
|
exit 1
|
|
fi
|
|
|
|
git codereview mail -r katie@golang.org,filippo@golang.org -trybot HEAD
|
|
cd - && git worktree remove "$WORKTREE"
|