diff options
author | Diana Picus <diana.picus@linaro.org> | 2017-10-31 16:04:27 +0100 |
---|---|---|
committer | Diana Picus <diana.picus@linaro.org> | 2017-10-31 16:04:27 +0100 |
commit | 7fefe1e34549a439f42facfa1bf769b35a48cffe (patch) | |
tree | 286e7dc7e5a46169047b175adb617589f72a6af8 /helpers | |
parent | efc7bdaf3f4e53b0b9c15c4b1100dcf2e9d30b09 (diff) |
Replace git-push with llvm-push
git-push is uninteresting and nobody uses it. Instead, we could use a
wrapper over llvm.py push, which pushes the current branch for all
enabled subprojects.
Change-Id: I558bc41362d3ed14efdbe269041b467f5789f28e
Diffstat (limited to 'helpers')
-rwxr-xr-x | helpers/git-push | 42 | ||||
-rwxr-xr-x | helpers/llvm-push | 21 |
2 files changed, 21 insertions, 42 deletions
diff --git a/helpers/git-push b/helpers/git-push deleted file mode 100755 index 2869dcf..0000000 --- a/helpers/git-push +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -# This script pushes the current branch to the origin repository. -# As an added bonus, it refreshes the local master branch from -# the origin, to make sure your branch is in sync with the master of the -# repo you're pushing to. -# -# Syntax: git-push [branch (default=current)] - -. llvm-common - -branch= -if [[ $1 != '' ]]; then - if [[ `git branch | grep $1` = '' ]]; then - echo "Branch '$1' doesn't exist in this repository" - exit 2 - fi - branch=$1 -else - branch=`get_branch` -fi - -if [[ $branch = 'master' ]]; then - echo "Can't push the master branch." - echo "Use git-refresh instead." - exit 1 -fi - -prefix="linaro-local/" -if echo $branch | grep -q linaro-local; then - prefix="" -fi - -echo " ++ Refresh Master from Upstream" -safe_run git-refresh - -echo " ++ Rebase to new master" -safe_run git checkout $branch -safe_run git rebase master - -echo " ++ Push $branch to Origin" -safe_run git push -u origin +$branch:$prefix$branch diff --git a/helpers/llvm-push b/helpers/llvm-push new file mode 100755 index 0000000..54fee83 --- /dev/null +++ b/helpers/llvm-push @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Shorthand script for pushing the current branch to origin on all enabled llvm +# subprojects. It calls llvm.py to do the actual work. + +prog=$(basename $0) +progdir=$(dirname $0) +llvmtool=$progdir/../scripts/llvm.py + +syntax() { + echo "Syntax: $prog" + echo "Push the current branch into the linaro-local namespace" + echo "Works for all enabled subprojects" +} + +. llvm-common +verify_env +repos=$LLVM_ROOT/repos +env=$(dirname $LLVM_SRC) + +safe_run python3 $llvmtool --repos $repos --env $env push |