File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- set -u -e -o pipefail
3+ # TODO: Remove this deprecation warning after a reasonable period.
44
5- BASEDIR=$( dirname " $0 " )
6-
7- if [ $# -eq 0 ]; then
8- echo " Rebase github PR onto a branch"
9- echo
10- echo " $0 branch_to_rebase_on PR_NUMBER"
11- echo
12- exit 0
13- fi
14-
15- REBASE_ON=" $1 "
16- PR_NO=" $2 "
17-
18-
19- HEAD_LABEL=` curl -s https://api.github.com/repos/angular/angular/pulls/$PR_NO | node $BASEDIR /utils/json_extract.js head.label`
20- echo $HEAD_LABEL
21- IFS=' :' read -r -a array <<< " $HEAD_LABEL"
22- USER=" ${array[0]} "
23- USER_GIT_URL=
" [email protected] :$USER /angular.git" 24- BRANCH=" ${array[1]} "
25- OLD_BRANCH=` git branch | grep \* | cut -d ' ' -f2`
26-
27- echo =====================================================
28- echo Rebasing $USER_GIT_URL branch $BRANCH onto $REBASE_ON
29- echo =====================================================
30-
31- git fetch $USER_GIT_URL $BRANCH
32- git checkout FETCH_HEAD
33- PUSH_CMD=" git push $USER_GIT_URL HEAD:$BRANCH -f" ;
34- RESTORE_CMD=" git checkout $OLD_BRANCH "
35- git rebase upstream/master
36- if [ $? -eq 0 ]; then
37- $PUSH_CMD
38- $RESTORE_CMD
39- else
40- echo ===========================
41- echo Git rebase failed. RECOVER WITH:
42- echo " $PUSH_CMD "
43- echo " $RESTORE_CMD "
44- echo ===========================
45- fi
5+ echo " The rebase script has been replaced by the rebase script provided in ng-dev" ;
6+ echo " To run the rebase via ng-dev run the following command:"
7+ echo " $ yarn -s ng-dev pr rebase <pr-number>"
You can’t perform that action at this time.
0 commit comments