summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2011-05-13 13:10:14 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-19 23:40:38 +0100
commitdca0c4846577205458615f1937290b954e77c28b (patch)
treedd64f3e21a8e84394b77b9200c94972c6c738cf9
parent5ad2ebadfb4b931875edead5f1b3d6d1490b29a9 (diff)
downloadpoky-dca0c4846577205458615f1937290b954e77c28b.tar.gz
poky-dca0c4846577205458615f1937290b954e77c28b.tar.bz2
poky-dca0c4846577205458615f1937290b954e77c28b.zip
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-xscripts/create-pull-request24
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-$$
RELATIVE_TO="master"
COMMIT_ID="HEAD"
PREFIX="PATCH"
+RFC=0
usage() {
CMD=$(basename $0)
cat <<EOM
Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to] [-i commit_id] -u remote -b branch
-b branch Branch name in the specified remote
+ -c Create an RFC (Request for Comment) patch series
-h Display this help message
-i commit_id Ending commit (default: HEAD)
-m msg_body_file The file containing a blurb to be inserted into the summary email
@@ -27,11 +29,14 @@ EOM
}
# Parse and validate arguments
-while getopts "b:hi:m:o:p:r:s:u:" OPT; do
+while getopts "b:chi:m:o:p:r:s:u:" OPT; do
case $OPT in
b)
BRANCH="$OPTARG"
;;
+ c)
+ RFC=1
+ ;;
h)
usage
exit 0
@@ -89,6 +94,10 @@ if [ -z "$BRANCH" ] || [ -z "$REMOTE_URL" ]; then
exit 1
fi
+if [ $RFC -eq 1 ]; then
+ PREFIX="RFC $PREFIX"
+fi
+
# Set WEB_URL from known remotes
case "$REMOTE_URL" in
@@ -125,7 +134,7 @@ git format-patch -M --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --co
# Customize the cover letter
CL="$ODIR/0000-cover-letter.patch"
PM="$ODIR/pull-msg"
-git request-pull $RELATIVE_TO $REMOTE_URL $COMMIT_ID > "$PM"
+git request-pull $RELATIVE_TO $REMOTE_URL $COMMIT_ID >> "$PM"
if [ $? -ne 0 ]; then
echo "ERROR: git request-pull reported an error"
exit 1
@@ -136,6 +145,17 @@ fi
sed -n "0,\#$REMOTE_URL# p" "$PM" | sed -i "/BLURB HERE/ r /dev/stdin" "$CL"
rm "$PM"
+# If this is an RFC, make that clear in the cover letter
+if [ $RFC -eq 1 ]; then
+(cat <<EOM
+Please review the following changes for suitability for inclusion. If you have
+any objections or suggestions for improvement, please respond to the patches. If
+you agree with the changes, please provide your Acked-by.
+
+EOM
+) | sed -i "/BLURB HERE/ r /dev/stdin" "$CL"
+fi
+
# Insert the WEB_URL if there is one
if [ -n "$WEB_URL" ]; then
echo " $WEB_URL" | sed -i "\#$REMOTE_URL# r /dev/stdin" "$CL"