diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-07-30 14:10:51 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-01 07:34:06 +0100 |
commit | 90bc2f35d0643a0be8570a6f6e85b3c20a2512be (patch) | |
tree | 0cd36934d45e97d53de47dded8769ef197da032e /scripts | |
parent | 363bec05e6e5c2be2d8d7ea23e48fee2a1ce14ad (diff) | |
download | poky-90bc2f35d0643a0be8570a6f6e85b3c20a2512be.tar.gz |
create-pull-request: Implement -d option
This options allows to generate patches against relative directory by
using git format-patch --relative option.
See more details about --relative option in git diff manual page.
For example generating bitbake patchsets from poky can be
done this way: create-pull-request -u contrib -d ./bitbake
(From OE-Core rev: 9b544125e1e3d2cc2db8f5d20d6fd0746f8cef5d)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/create-pull-request | 16 |
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 | |||
34 | usage() { | 34 | usage() { |
35 | CMD=$(basename $0) | 35 | CMD=$(basename $0) |
36 | cat <<EOM | 36 | cat <<EOM |
37 | Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to] [-i commit_id] -u remote [-b branch] | 37 | Usage: $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 | ||
54 | EOM | 56 | EOM |
55 | } | 57 | } |
56 | 58 | ||
57 | # Parse and validate arguments | 59 | # Parse and validate arguments |
58 | while getopts "b:chi:m:o:p:r:s:u:" OPT; do | 60 | while 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 | |||
170 | fi | 175 | fi |
171 | mkdir $ODIR | 176 | mkdir $ODIR |
172 | 177 | ||
178 | if [ -n "$RELDIR" ]; then | ||
179 | ODIR=$(realpath $ODIR) | ||
180 | extraopts="--relative=$RELDIR" | ||
181 | fi | ||
173 | 182 | ||
174 | # Generate the patches and cover letter | 183 | # Generate the patches and cover letter |
175 | git format-patch -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null | 184 | git 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 |
179 | CL="$ODIR/0000-cover-letter.patch" | 187 | CL="$ODIR/0000-cover-letter.patch" |