diff --git a/README.md b/README.md index 8f29c49..555fb52 100644 --- a/README.md +++ b/README.md @@ -85,9 +85,7 @@ Every now and then a new Clang subminor version is released. The given version c $GOPATH/src/github.com/go-clang/gen/scripts/update-clang-version.sh 3.4 ``` -This will reset the commits of the `v3.4` repository to the latest commit of the `bootstrap` repository. The command also generates, installs, configures and tests bindings for the given Clang version. The changes must then be manually verified, added, committed and pushed to the already set up remote "origin". - -> **Please note**, since we generate the whole binding anew we do not need the old commits and thus just throw them away. +This will rebase the latest commits of the `bootstrap` repository onto the commits of the `v3.4` repository. The command also generates, installs, configures and tests bindings for the given Clang version. The changes must then be manually verified, added, committed and pushed to the already set up remote "origin". ### Update branches with a new `go-clang/gen` version (VM) diff --git a/scripts/update-clang-version.sh b/scripts/update-clang-version.sh index 14a7a58..3c06d05 100755 --- a/scripts/update-clang-version.sh +++ b/scripts/update-clang-version.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -exuo pipefail + if [ -z "$1" ]; then exit fi @@ -7,18 +9,14 @@ fi export LLVM_VERSION=$1 # Switch Clang version -$(dirname "$0")/switch-clang-version.sh $LLVM_VERSION || exit +$(dirname "$0")/switch-clang-version.sh $LLVM_VERSION # Update the repository -cd v${LLVM_VERSION} || exit +cd v${LLVM_VERSION} -git checkout bootstrap/master || exit -LAST_BOOTSTRAP=$(git rev-parse HEAD) -git checkout master -git reset --hard $LAST_BOOTSTRAP +git fetch --prune bootstrap -git fetch --prune bootstrap || exit -git rebase bootstrap/master master +git rebase master bootstrap/master # Generate the new Clang version -$(dirname "$0")/generate-and-test.sh $LLVM_VERSION || exit +$(dirname "$0")/generate-and-test.sh $LLVM_VERSION