From: Jose Lamego Date: Tue, 4 Apr 2017 21:45:09 +0000 (-0500) Subject: create-pull-request: add "-t in-reply-to" option X-Git-Tag: uninative-1.7~945 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=8a3879a8ca71db7fb313417d86b3ac7904cb0f0e;p=openembedded-core.git 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] Signed-off-by: Jose Lamego Signed-off-by: Ross Burton --- 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 usage() { CMD=$(basename $0) cat <" EOM } REMOTE="$CPR_CONTRIB_REMOTE" # Parse and validate arguments -while getopts "b:acd:hi:m:o:p:r:s:u:l:" OPT; do +while getopts "b:acd:hi:m:o:p:r:s:u:l:t:" OPT; do case $OPT in b) BRANCH="$OPTARG" @@ -108,6 +110,8 @@ while getopts "b:acd:hi:m:o:p:r:s:u:l:" OPT; do a) CPR_CONTRIB_AUTO_PUSH="1" ;; + t) + IN_REPLY_TO="$OPTARG" esac done @@ -205,7 +209,11 @@ if [ -n "$RELDIR" ]; then fi # Generate the patches and cover letter -git format-patch $extraopts -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null +if [ -z "$IN_REPLY_TO" ]; then + 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 +else + git format-patch $extraopts -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null +fi if [ -z "$(ls -A $ODIR 2> /dev/null)" ]; then echo "ERROR: $ODIR is empty, no cover letter and patches was generated!"