summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2016-04-05 19:31:27 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-06 22:57:26 +0100
commit298d875fac41d58bb14d208e5aebd0426208685b (patch)
tree8e95e420c2af1af482f49d7669c4e4899f2ff98a /scripts
parent4faeff9286153a8b4a52fb08684ded8c8578405f (diff)
downloadpoky-298d875fac41d58bb14d208e5aebd0426208685b.tar.gz
create-pull-request: fix for newer git
Fixed when git > 2.1.0: $ ./scripts/create-pull-request -r HEAD^ -u contrib -b rbt/git fatal: Not a valid revision: rbt/git ERROR: git request-pull reported an error This is because newer git requires both local and remote branch named as rbt/git, but usually, we only named the remote branch as rbt/foo, and foo for local branch. Add a option '-l' to fix the problem, default is HEAD. (From OE-Core rev: 98faa3ec872e06774b5870fcfb52f3ff91494779) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/create-pull-request14
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index dd66dfe46e..479ad6efc9 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -36,6 +36,7 @@ CMD=$(basename $0)
36cat <<EOM 36cat <<EOM
37Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to] [-i commit_id] [-d relative_dir] -u remote [-b branch] 37Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to] [-i commit_id] [-d relative_dir] -u remote [-b branch]
38 -b branch Branch name in the specified remote (default: current branch) 38 -b branch Branch name in the specified remote (default: current branch)
39 -l local branch Local branch name (default: HEAD)
39 -c Create an RFC (Request for Comment) patch series 40 -c Create an RFC (Request for Comment) patch series
40 -h Display this help message 41 -h Display this help message
41 -i commit_id Ending commit (default: HEAD) 42 -i commit_id Ending commit (default: HEAD)
@@ -50,6 +51,7 @@ Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to
50 Examples: 51 Examples:
51 $CMD -u contrib -b nitin/basic 52 $CMD -u contrib -b nitin/basic
52 $CMD -u contrib -r distro/master -i nitin/distro -b nitin/distro 53 $CMD -u contrib -r distro/master -i nitin/distro -b nitin/distro
54 $CMD -u contrib -r distro/master -i nitin/distro -b nitin/distro -l distro
53 $CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc 55 $CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc
54 $CMD -u contrib -p "RFC PATCH" -b nitin/experimental 56 $CMD -u contrib -p "RFC PATCH" -b nitin/experimental
55 $CMD -u contrib -i misc -b nitin/misc -d ./bitbake 57 $CMD -u contrib -i misc -b nitin/misc -d ./bitbake
@@ -57,11 +59,14 @@ EOM
57} 59}
58 60
59# Parse and validate arguments 61# Parse and validate arguments
60while getopts "b:cd:hi:m:o:p:r:s:u:" OPT; do 62while getopts "b:cd:hi:m:o:p:r:s:u:l:" OPT; do
61 case $OPT in 63 case $OPT in
62 b) 64 b)
63 BRANCH="$OPTARG" 65 BRANCH="$OPTARG"
64 ;; 66 ;;
67 l)
68 L_BRANCH="$OPTARG"
69 ;;
65 c) 70 c)
66 RFC=1 71 RFC=1
67 ;; 72 ;;
@@ -130,6 +135,11 @@ if [ -z "$BRANCH" ]; then
130 echo "NOTE: Assuming remote branch '$BRANCH', use -b to override." 135 echo "NOTE: Assuming remote branch '$BRANCH', use -b to override."
131fi 136fi
132 137
138if [ -z "$L_BRANCH" ]; then
139 L_BRANCH=HEAD
140 echo "NOTE: Assuming local branch HEAD, use -l to override."
141fi
142
133if [ -z "$REMOTE_URL" ]; then 143if [ -z "$REMOTE_URL" ]; then
134 echo "ERROR: Missing parameter -u, no git remote!" 144 echo "ERROR: Missing parameter -u, no git remote!"
135 usage 145 usage
@@ -203,7 +213,7 @@ NEWER_GIT_VERSION=210
203if [ $GIT_VERSION -lt $NEWER_GIT_VERSION ]; then 213if [ $GIT_VERSION -lt $NEWER_GIT_VERSION ]; then
204 git request-pull $RELATIVE_TO $REMOTE_URL $COMMIT_ID >> "$PM" 214 git request-pull $RELATIVE_TO $REMOTE_URL $COMMIT_ID >> "$PM"
205else 215else
206 git request-pull $RELATIVE_TO $REMOTE_URL $BRANCH:$BRANCH >> "$PM" 216 git request-pull $RELATIVE_TO $REMOTE_URL $L_BRANCH:$BRANCH >> "$PM"
207fi 217fi
208if [ $? -ne 0 ]; then 218if [ $? -ne 0 ]; then
209 echo "ERROR: git request-pull reported an error" 219 echo "ERROR: git request-pull reported an error"