diff options
author | Jose Lamego <jose.a.lamego@linux.intel.com> | 2017-04-04 16:45:09 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-05-11 16:59:19 +0100 |
commit | 3ad3fda6c5f084f4fa1485b30aa333287989bee7 (patch) | |
tree | 645d361138531869e4b36294081e1cd703ccb709 /scripts/create-pull-request | |
parent | 79189ea3b27898ec7d40ea9c88371743f79793c4 (diff) | |
download | poky-3ad3fda6c5f084f4fa1485b30aa333287989bee7.tar.gz |
create-pull-request: add "-t in-reply-to" option
The create-patch-request script creates patches as replies to a cover
letter, in the form of an email thread. If further revisions are sent to
the mailing list without referencing to the first revision, these new
revisions are not identified at the mailing list as part of the original
thread, but as a new thread instead.
This change adds the "[-t in_reply_to]" option, where "in_reply_to" is
the original cover letter's Message-Id, so this reference is added
to the new cover letter to ensure the thread continuity.
[YOCTO #11294]
(From OE-Core rev: 8a3879a8ca71db7fb313417d86b3ac7904cb0f0e)
Signed-off-by: Jose Lamego <jose.a.lamego@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/create-pull-request')
-rwxr-xr-x | scripts/create-pull-request | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/create-pull-request b/scripts/create-pull-request index e82858bc98..46d65386a3 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] [-d relative_dir] -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] [-t in_reply_to] |
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 | -l local branch Local branch name (default: HEAD) |
40 | -c Create an RFC (Request for Comment) patch series | 40 | -c Create an RFC (Request for Comment) patch series |
@@ -49,6 +49,7 @@ Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to | |||
49 | -s subject The subject to be inserted into the summary email | 49 | -s subject The subject to be inserted into the summary email |
50 | -u remote The git remote where the branch is located, or set CPR_CONTRIB_REMOTE in env | 50 | -u remote The git remote where the branch is located, or set CPR_CONTRIB_REMOTE in env |
51 | -d relative_dir Generate patches relative to directory | 51 | -d relative_dir Generate patches relative to directory |
52 | -t in_reply_to Make mails appear as replies to the given Message-Id, to continue patch/series threads | ||
52 | 53 | ||
53 | Examples: | 54 | Examples: |
54 | $CMD -u contrib -b nitin/basic | 55 | $CMD -u contrib -b nitin/basic |
@@ -57,12 +58,13 @@ Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to | |||
57 | $CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc | 58 | $CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc |
58 | $CMD -u contrib -p "RFC PATCH" -b nitin/experimental | 59 | $CMD -u contrib -p "RFC PATCH" -b nitin/experimental |
59 | $CMD -u contrib -i misc -b nitin/misc -d ./bitbake | 60 | $CMD -u contrib -i misc -b nitin/misc -d ./bitbake |
61 | $CMD -u contrib -p "OE-core][PATCH v2" -t "<cover.11146.git.john.doe@example.com>" | ||
60 | EOM | 62 | EOM |
61 | } | 63 | } |
62 | 64 | ||
63 | REMOTE="$CPR_CONTRIB_REMOTE" | 65 | REMOTE="$CPR_CONTRIB_REMOTE" |
64 | # Parse and validate arguments | 66 | # Parse and validate arguments |
65 | while getopts "b:acd:hi:m:o:p:r:s:u:l:" OPT; do | 67 | while getopts "b:acd:hi:m:o:p:r:s:u:l:t:" OPT; do |
66 | case $OPT in | 68 | case $OPT in |
67 | b) | 69 | b) |
68 | BRANCH="$OPTARG" | 70 | BRANCH="$OPTARG" |
@@ -108,6 +110,8 @@ while getopts "b:acd:hi:m:o:p:r:s:u:l:" OPT; do | |||
108 | a) | 110 | a) |
109 | CPR_CONTRIB_AUTO_PUSH="1" | 111 | CPR_CONTRIB_AUTO_PUSH="1" |
110 | ;; | 112 | ;; |
113 | t) | ||
114 | IN_REPLY_TO="$OPTARG" | ||
111 | esac | 115 | esac |
112 | done | 116 | done |
113 | 117 | ||
@@ -205,7 +209,11 @@ if [ -n "$RELDIR" ]; then | |||
205 | fi | 209 | fi |
206 | 210 | ||
207 | # Generate the patches and cover letter | 211 | # Generate the patches and cover letter |
208 | git format-patch $extraopts -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null | 212 | if [ -z "$IN_REPLY_TO" ]; then |
213 | git format-patch $extraopts -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --in-reply-to="$IN_REPLY_TO" --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null | ||
214 | else | ||
215 | git format-patch $extraopts -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null | ||
216 | fi | ||
209 | 217 | ||
210 | if [ -z "$(ls -A $ODIR 2> /dev/null)" ]; then | 218 | if [ -z "$(ls -A $ODIR 2> /dev/null)" ]; then |
211 | echo "ERROR: $ODIR is empty, no cover letter and patches was generated!" | 219 | echo "ERROR: $ODIR is empty, no cover letter and patches was generated!" |