From 1190768f4b4c75b0decee2b31d0618f6821a3a1c Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 12 Aug 2017 15:39:29 +0200 Subject: [PATCH] chore: remove all PR scripts. --- .github/cpr.sh | 26 -------------------------- .github/pfpr.sh | 24 ------------------------ .github/rmpr.sh | 27 --------------------------- .github/rpr.sh | 36 ------------------------------------ 4 files changed, 113 deletions(-) delete mode 100755 .github/cpr.sh delete mode 100755 .github/pfpr.sh delete mode 100755 .github/rmpr.sh delete mode 100755 .github/rpr.sh diff --git a/.github/cpr.sh b/.github/cpr.sh deleted file mode 100755 index 322259d14..000000000 --- a/.github/cpr.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# -# git config --global alias.cpr '!sh .github/cpr.sh' - -set -e # stop on error - -usage="$(basename "$0") pr -- Checkout a Pull Request locally" - -if [ "$#" -ne 1 ]; then - echo "Illegal number of parameters" - echo "$usage" >&2 - exit 1 -fi - -command -v jq >/dev/null 2>&1 || { echo "I require jq but it's not installed. Aborting." >&2; exit 1; } - -set -x # echo on - -initial=$(git rev-parse --abbrev-ref HEAD) -pr=$1 -remote=$(curl -s https://api.github.com/repos/containous/traefik/pulls/$pr | jq -r .head.repo.owner.login) -branch=$(curl -s https://api.github.com/repos/containous/traefik/pulls/$pr | jq -r .head.ref) - -git remote add $remote git@github.com:$remote/traefik.git -git fetch $remote $branch -git checkout -t -b "$pr--$branch" $remote/$branch \ No newline at end of file diff --git a/.github/pfpr.sh b/.github/pfpr.sh deleted file mode 100755 index 848147cb5..000000000 --- a/.github/pfpr.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -# -# git config --global alias.pfpr '!sh .github/pfpr.sh' - -set -e # stop on error - -usage="$(basename "$0") pr -- Push force a Pull Request branch" - -if [ "$#" -ne 1 ]; then - echo "Illegal number of parameters" - echo "$usage" >&2 - exit 1 -fi - -command -v jq >/dev/null 2>&1 || { echo "I require jq but it's not installed. Aborting." >&2; exit 1; } - -set -x # echo on - -initial=$(git rev-parse --abbrev-ref HEAD) -pr=$1 -remote=$(curl -s https://api.github.com/repos/containous/traefik/pulls/$pr | jq -r .head.repo.owner.login) -branch=$(curl -s https://api.github.com/repos/containous/traefik/pulls/$pr | jq -r .head.ref) - -git push --force-with-lease $remote $pr--$branch:$branch diff --git a/.github/rmpr.sh b/.github/rmpr.sh deleted file mode 100755 index 1ca63bf15..000000000 --- a/.github/rmpr.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# -# git config --global alias.rmpr '!sh .github/rmpr.sh' - -set -e # stop on error - -usage="$(basename "$0") pr -- remove a Pull Request local branch & remote" - -if [ "$#" -ne 1 ]; then - echo "Illegal number of parameters" - echo "$usage" >&2 - exit 1 -fi - -command -v jq >/dev/null 2>&1 || { echo "I require jq but it's not installed. Aborting." >&2; exit 1; } - -set -x # echo on - -initial=$(git rev-parse --abbrev-ref HEAD) -pr=$1 -remote=$(curl -s https://api.github.com/repos/containous/traefik/pulls/$pr | jq -r .head.repo.owner.login) -branch=$(curl -s https://api.github.com/repos/containous/traefik/pulls/$pr | jq -r .head.ref) - -# clean -git checkout $initial -git branch -D "$pr--$branch" -git remote remove $remote \ No newline at end of file diff --git a/.github/rpr.sh b/.github/rpr.sh deleted file mode 100755 index b96cd9b77..000000000 --- a/.github/rpr.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -# -# git config --global alias.rpr '!sh .github/rpr.sh' - -set -e # stop on error - -usage="$(basename "$0") pr remote/branch -- rebase a Pull Request against a remote branch" - -if [ "$#" -ne 2 ]; then - echo "Illegal number of parameters" - echo "$usage" >&2 - exit 1 -fi - -command -v jq >/dev/null 2>&1 || { echo "I require jq but it's not installed. Aborting." >&2; exit 1; } - -set -x # echo on - -initial=$(git rev-parse --abbrev-ref HEAD) -pr=$1 -base=$2 -remote=$(curl -s https://api.github.com/repos/containous/traefik/pulls/$pr | jq -r .head.repo.owner.login) -branch=$(curl -s https://api.github.com/repos/containous/traefik/pulls/$pr | jq -r .head.ref) - -clean () -{ - git checkout $initial - .github/rmpr.sh $pr -} - -trap clean EXIT - -.github/cpr.sh $pr - -git rebase $base -git push --force-with-lease $remote $pr--$branch:$branch