diff options
| author | Darren Hart <dvhart@linux.intel.com> | 2011-05-13 13:10:14 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-19 23:40:38 +0100 |
| commit | dca0c4846577205458615f1937290b954e77c28b (patch) | |
| tree | dd64f3e21a8e84394b77b9200c94972c6c738cf9 | |
| parent | 5ad2ebadfb4b931875edead5f1b3d6d1490b29a9 (diff) | |
| download | poky-dca0c4846577205458615f1937290b954e77c28b.tar.gz | |
create-pull-request: provide an RFC mode via -c argument
Currently it is difficult to know if a pull request is being sent for review
or just to be pulled.
Add a -c argument to add RFC to the subject prefix and a blurb requesting
review to the cover letter.
(From OE-Core rev: e4f66ec2a8af56fb4d0a85df46bfaa3bb1409d31)
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Acked-by: Joshua Lock <josh@linux.intel.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Saul Wold <sgw@linux.intel.com>
Cc: Paul Eggleton <paul.eggleton@intel.com>
Cc: Joshua Lock <josh@linux.intel.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rwxr-xr-x | scripts/create-pull-request | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/scripts/create-pull-request b/scripts/create-pull-request index 429421b24e..202d99d120 100755 --- a/scripts/create-pull-request +++ b/scripts/create-pull-request | |||
| @@ -3,12 +3,14 @@ ODIR=pull-$$ | |||
| 3 | RELATIVE_TO="master" | 3 | RELATIVE_TO="master" |
| 4 | COMMIT_ID="HEAD" | 4 | COMMIT_ID="HEAD" |
| 5 | PREFIX="PATCH" | 5 | PREFIX="PATCH" |
| 6 | RFC=0 | ||
| 6 | 7 | ||
| 7 | usage() { | 8 | usage() { |
| 8 | CMD=$(basename $0) | 9 | CMD=$(basename $0) |
| 9 | cat <<EOM | 10 | cat <<EOM |
| 10 | Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to] [-i commit_id] -u remote -b branch | 11 | Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to] [-i commit_id] -u remote -b branch |
| 11 | -b branch Branch name in the specified remote | 12 | -b branch Branch name in the specified remote |
| 13 | -c Create an RFC (Request for Comment) patch series | ||
| 12 | -h Display this help message | 14 | -h Display this help message |
| 13 | -i commit_id Ending commit (default: HEAD) | 15 | -i commit_id Ending commit (default: HEAD) |
| 14 | -m msg_body_file The file containing a blurb to be inserted into the summary email | 16 | -m msg_body_file The file containing a blurb to be inserted into the summary email |
| @@ -27,11 +29,14 @@ EOM | |||
| 27 | } | 29 | } |
| 28 | 30 | ||
| 29 | # Parse and validate arguments | 31 | # Parse and validate arguments |
| 30 | while getopts "b:hi:m:o:p:r:s:u:" OPT; do | 32 | while getopts "b:chi:m:o:p:r:s:u:" OPT; do |
| 31 | case $OPT in | 33 | case $OPT in |
| 32 | b) | 34 | b) |
| 33 | BRANCH="$OPTARG" | 35 | BRANCH="$OPTARG" |
| 34 | ;; | 36 | ;; |
| 37 | c) | ||
| 38 | RFC=1 | ||
| 39 | ;; | ||
| 35 | h) | 40 | h) |
| 36 | usage | 41 | usage |
| 37 | exit 0 | 42 | exit 0 |
| @@ -89,6 +94,10 @@ if [ -z "$BRANCH" ] || [ -z "$REMOTE_URL" ]; then | |||
| 89 | exit 1 | 94 | exit 1 |
| 90 | fi | 95 | fi |
| 91 | 96 | ||
| 97 | if [ $RFC -eq 1 ]; then | ||
| 98 | PREFIX="RFC $PREFIX" | ||
| 99 | fi | ||
| 100 | |||
| 92 | 101 | ||
| 93 | # Set WEB_URL from known remotes | 102 | # Set WEB_URL from known remotes |
| 94 | case "$REMOTE_URL" in | 103 | case "$REMOTE_URL" in |
| @@ -125,7 +134,7 @@ git format-patch -M --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --co | |||
| 125 | # Customize the cover letter | 134 | # Customize the cover letter |
| 126 | CL="$ODIR/0000-cover-letter.patch" | 135 | CL="$ODIR/0000-cover-letter.patch" |
| 127 | PM="$ODIR/pull-msg" | 136 | PM="$ODIR/pull-msg" |
| 128 | git request-pull $RELATIVE_TO $REMOTE_URL $COMMIT_ID > "$PM" | 137 | git request-pull $RELATIVE_TO $REMOTE_URL $COMMIT_ID >> "$PM" |
| 129 | if [ $? -ne 0 ]; then | 138 | if [ $? -ne 0 ]; then |
| 130 | echo "ERROR: git request-pull reported an error" | 139 | echo "ERROR: git request-pull reported an error" |
| 131 | exit 1 | 140 | exit 1 |
| @@ -136,6 +145,17 @@ fi | |||
| 136 | sed -n "0,\#$REMOTE_URL# p" "$PM" | sed -i "/BLURB HERE/ r /dev/stdin" "$CL" | 145 | sed -n "0,\#$REMOTE_URL# p" "$PM" | sed -i "/BLURB HERE/ r /dev/stdin" "$CL" |
| 137 | rm "$PM" | 146 | rm "$PM" |
| 138 | 147 | ||
| 148 | # If this is an RFC, make that clear in the cover letter | ||
| 149 | if [ $RFC -eq 1 ]; then | ||
| 150 | (cat <<EOM | ||
| 151 | Please review the following changes for suitability for inclusion. If you have | ||
| 152 | any objections or suggestions for improvement, please respond to the patches. If | ||
| 153 | you agree with the changes, please provide your Acked-by. | ||
| 154 | |||
| 155 | EOM | ||
| 156 | ) | sed -i "/BLURB HERE/ r /dev/stdin" "$CL" | ||
| 157 | fi | ||
| 158 | |||
| 139 | # Insert the WEB_URL if there is one | 159 | # Insert the WEB_URL if there is one |
| 140 | if [ -n "$WEB_URL" ]; then | 160 | if [ -n "$WEB_URL" ]; then |
| 141 | echo " $WEB_URL" | sed -i "\#$REMOTE_URL# r /dev/stdin" "$CL" | 161 | echo " $WEB_URL" | sed -i "\#$REMOTE_URL# r /dev/stdin" "$CL" |
