diff options
Diffstat (limited to 'scripts/create-pull-request')
-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." |