diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2016-04-19 17:30:03 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-04 15:22:23 +0100 |
commit | a15826520f26d922551f2561bd1518a114c639c5 (patch) | |
tree | bfb79b057a76aee0b9d2cc887eaf5c963b005687 | |
parent | ca5645901b82d6ee448d1c7d38e87fbfda15c47e (diff) | |
download | poky-a15826520f26d922551f2561bd1518a114c639c5.tar.gz |
create-pull-request: add option -a to auto push
Before this patch, we need two steps to create PULL:
* Step 1, create branch:
$ git push <contrib> <local_branch>:<remote_branch>
* Step 2, create PULL:
$ create-pull-request -u <contrib> -l <local_branch> -b <remote_branch> -r <local_branch>~<n>
We can see that the args used in step 1 are in step 2, so we can use
"create-pull-request -a" or set CPR_CONTRIB_AUTO_PUSH in to create the
branch to simplify the steps.
[YOCTO #9408]
(From OE-Core rev: a569bec9219394703d1c1d9b28dd19bf5b058e7f)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | scripts/create-pull-request | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/create-pull-request b/scripts/create-pull-request index 479ad6efc9..a60d5b0330 100755 --- a/scripts/create-pull-request +++ b/scripts/create-pull-request | |||
@@ -39,6 +39,8 @@ Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to | |||
39 | -l local branch Local branch name (default: HEAD) | 39 | -l local branch Local branch name (default: HEAD) |
40 | -c Create an RFC (Request for Comment) patch series | 40 | -c Create an RFC (Request for Comment) patch series |
41 | -h Display this help message | 41 | -h Display this help message |
42 | -a Automatically push local branch (-l) to remote branch (-b), | ||
43 | or set CPR_CONTRIB_AUTO_PUSH in env | ||
42 | -i commit_id Ending commit (default: HEAD) | 44 | -i commit_id Ending commit (default: HEAD) |
43 | -m msg_body_file The file containing a blurb to be inserted into the summary email | 45 | -m msg_body_file The file containing a blurb to be inserted into the summary email |
44 | -o output_dir Specify the output directory for the messages (default: pull-PID) | 46 | -o output_dir Specify the output directory for the messages (default: pull-PID) |
@@ -59,7 +61,7 @@ EOM | |||
59 | } | 61 | } |
60 | 62 | ||
61 | # Parse and validate arguments | 63 | # Parse and validate arguments |
62 | while getopts "b:cd:hi:m:o:p:r:s:u:l:" OPT; do | 64 | while getopts "b:acd:hi:m:o:p:r:s:u:l:" OPT; do |
63 | case $OPT in | 65 | case $OPT in |
64 | b) | 66 | b) |
65 | BRANCH="$OPTARG" | 67 | BRANCH="$OPTARG" |
@@ -127,6 +129,9 @@ while getopts "b:cd:hi:m:o:p:r:s:u:l:" OPT; do | |||
127 | ;; | 129 | ;; |
128 | esac | 130 | esac |
129 | ;; | 131 | ;; |
132 | a) | ||
133 | CPR_CONTRIB_AUTO_PUSH="1" | ||
134 | ;; | ||
130 | esac | 135 | esac |
131 | done | 136 | done |
132 | 137 | ||
@@ -171,6 +176,11 @@ esac | |||
171 | # Perform a sanity test on the web URL. Issue a warning if it is not | 176 | # Perform a sanity test on the web URL. Issue a warning if it is not |
172 | # accessible, but do not abort as users may want to run offline. | 177 | # accessible, but do not abort as users may want to run offline. |
173 | if [ -n "$WEB_URL" ]; then | 178 | if [ -n "$WEB_URL" ]; then |
179 | if [ "$CPR_CONTRIB_AUTO_PUSH" = "1" ]; then | ||
180 | echo "Pushing '$BRANCH' on '$REMOTE' as requested..." | ||
181 | git push $REMOTE $L_BRANCH:$BRANCH | ||
182 | echo "" | ||
183 | fi | ||
174 | wget --no-check-certificate -q $WEB_URL -O /dev/null | 184 | wget --no-check-certificate -q $WEB_URL -O /dev/null |
175 | if [ $? -ne 0 ]; then | 185 | if [ $? -ne 0 ]; then |
176 | echo "WARNING: Branch '$BRANCH' was not found on the contrib git tree." | 186 | echo "WARNING: Branch '$BRANCH' was not found on the contrib git tree." |