summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2016-04-19 17:30:03 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-04 15:05:48 +0100
commita569bec9219394703d1c1d9b28dd19bf5b058e7f (patch)
tree0917a678488586169af7a9a9604e0b9827529316
parenta3f60d365e7ff20a1ad0875375b083a5baaaf9f1 (diff)
downloadopenembedded-core-a569bec9219394703d1c1d9b28dd19bf5b058e7f.tar.gz
openembedded-core-a569bec9219394703d1c1d9b28dd19bf5b058e7f.tar.bz2
openembedded-core-a569bec9219394703d1c1d9b28dd19bf5b058e7f.zip
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] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rwxr-xr-xscripts/create-pull-request12
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
-l local branch Local branch name (default: HEAD)
-c Create an RFC (Request for Comment) patch series
-h Display this help message
+ -a Automatically push local branch (-l) to remote branch (-b),
+ or set CPR_CONTRIB_AUTO_PUSH in env
-i commit_id Ending commit (default: HEAD)
-m msg_body_file The file containing a blurb to be inserted into the summary email
-o output_dir Specify the output directory for the messages (default: pull-PID)
@@ -59,7 +61,7 @@ EOM
}
# Parse and validate arguments
-while getopts "b:cd:hi:m:o:p:r:s:u:l:" OPT; do
+while getopts "b:acd:hi:m:o:p:r:s:u:l:" OPT; do
case $OPT in
b)
BRANCH="$OPTARG"
@@ -127,6 +129,9 @@ while getopts "b:cd:hi:m:o:p:r:s:u:l:" OPT; do
;;
esac
;;
+ a)
+ CPR_CONTRIB_AUTO_PUSH="1"
+ ;;
esac
done
@@ -171,6 +176,11 @@ esac
# Perform a sanity test on the web URL. Issue a warning if it is not
# accessible, but do not abort as users may want to run offline.
if [ -n "$WEB_URL" ]; then
+ if [ "$CPR_CONTRIB_AUTO_PUSH" = "1" ]; then
+ echo "Pushing '$BRANCH' on '$REMOTE' as requested..."
+ git push $REMOTE $L_BRANCH:$BRANCH
+ echo ""
+ fi
wget --no-check-certificate -q $WEB_URL -O /dev/null
if [ $? -ne 0 ]; then
echo "WARNING: Branch '$BRANCH' was not found on the contrib git tree."