[OE-core] [PATCH 1/3] create-pull-request: create branch on remote if not found

Robert Yang liezhi.yang at windriver.com
Tue Apr 19 02:45:30 UTC 2016


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 to create the branch if not found to simplify the
steps.

[YOCTO #9408]

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
---
 scripts/create-pull-request | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 479ad6e..7dc9836 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -173,8 +173,8 @@ esac
 if [ -n "$WEB_URL" ]; then
 	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."
-		echo "         Please check your remote and branch parameter before sending."
+		echo "Branch '$BRANCH' not found on '$REMOTE', creating it..."
+		git push $REMOTE $L_BRANCH:$BRANCH
 		echo ""
 	fi
 fi
-- 
2.7.4




More information about the Openembedded-core mailing list