summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/create-pull-request16
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 97ed874e7f..216edfd751 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -34,7 +34,7 @@ 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] [-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 -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
@@ -45,17 +45,19 @@ Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to
45 -r relative_to Starting commit (default: master) 45 -r relative_to Starting commit (default: master)
46 -s subject The subject to be inserted into the summary email 46 -s subject The subject to be inserted into the summary email
47 -u remote The git remote where the branch is located 47 -u remote The git remote where the branch is located
48 -d relative_dir Generate patches relative to directory
48 49
49 Examples: 50 Examples:
50 $CMD -u contrib -b nitin/basic 51 $CMD -u contrib -b nitin/basic
51 $CMD -u contrib -r distro/master -i nitin/distro -b nitin/distro 52 $CMD -u contrib -r distro/master -i nitin/distro -b nitin/distro
52 $CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc 53 $CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc
53 $CMD -u contrib -p "RFC PATCH" -b nitin/experimental 54 $CMD -u contrib -p "RFC PATCH" -b nitin/experimental
55 $CMD -u contrib -i misc -b nitin/misc -d ./bitbake
54EOM 56EOM
55} 57}
56 58
57# Parse and validate arguments 59# Parse and validate arguments
58while getopts "b:chi:m:o:p:r:s:u:" OPT; do 60while getopts "b:cd:hi:m:o:p:r:s:u:" OPT; do
59 case $OPT in 61 case $OPT in
60 b) 62 b)
61 BRANCH="$OPTARG" 63 BRANCH="$OPTARG"
@@ -63,6 +65,9 @@ while getopts "b:chi:m:o:p:r:s:u:" OPT; do
63 c) 65 c)
64 RFC=1 66 RFC=1
65 ;; 67 ;;
68 d)
69 RELDIR="$OPTARG"
70 ;;
66 h) 71 h)
67 usage 72 usage
68 exit 0 73 exit 0
@@ -170,10 +175,13 @@ if [ -e $ODIR ]; then
170fi 175fi
171mkdir $ODIR 176mkdir $ODIR
172 177
178if [ -n "$RELDIR" ]; then
179 ODIR=$(realpath $ODIR)
180 extraopts="--relative=$RELDIR"
181fi
173 182
174# Generate the patches and cover letter 183# Generate the patches and cover letter
175git format-patch -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null 184git format-patch $extraopts -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null
176
177 185
178# Customize the cover letter 186# Customize the cover letter
179CL="$ODIR/0000-cover-letter.patch" 187CL="$ODIR/0000-cover-letter.patch"