summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2012-04-05 14:24:43 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-10 13:31:58 +0100
commit177171ccf19b93618b04711af54c2e5c59a411ca (patch)
treecb48275973e2c4517c37008eed2ea8b9403254a3
parent190f6d791d51aaa4cfb9f1cf932bc205ff674fb5 (diff)
downloadpoky-177171ccf19b93618b04711af54c2e5c59a411ca.tar.gz
create-pull-request: Assume remote branch from local branch
It is common to use the same remote branch name as the local branch name. In this case, it would be nice not to have to specify the remote branch name. Make the -b argument optional and assume the remote branch is the same name as the local branch. Print a NOTE to this effect so as not to catch the user by surprise: NOTE: Assuming remote branch 'notthere', use -b to override. If the remote branch doesn't exist, a WARNING is displayed just as if the user had used -b to specify a non-existent branch: WARNING: Branch 'notthere' was not found on the contrib git tree. Please check your remote and branch parameter before sending. (From OE-Core rev: 62570b7e3db44fbc3461f650abe6c4613940e068) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/create-pull-request11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 600fa7a341..9a8913db72 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -34,8 +34,8 @@ RFC=0
34usage() { 34usage() {
35CMD=$(basename $0) 35CMD=$(basename $0)
36cat <<EOM 36cat <<EOM
37Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to] [-i commit_id] -u remote -b branch 37Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to] [-i commit_id] -u remote [-b branch]
38 -b branch Branch name in the specified remote 38 -b branch Branch name in the specified remote (default: current branch)
39 -c Create an RFC (Request for Comment) patch series 39 -c Create an RFC (Request for Comment) patch series
40 -h Display this help message 40 -h Display this help message
41 -i commit_id Ending commit (default: HEAD) 41 -i commit_id Ending commit (default: HEAD)
@@ -120,7 +120,12 @@ while getopts "b:chi:m:o:p:r:s:u:" OPT; do
120 esac 120 esac
121done 121done
122 122
123if [ -z "$BRANCH" ] || [ -z "$REMOTE_URL" ]; then 123if [ -z "$BRANCH" ]; then
124 BRANCH=$(git branch | grep -e "^\* " | cut -d' ' -f2)
125 echo "NOTE: Assuming remote branch '$BRANCH', use -b to override."
126fi
127
128if [ -z "$REMOTE_URL" ]; then
124 usage 129 usage
125 exit 1 130 exit 1
126fi 131fi