From 3ad3fda6c5f084f4fa1485b30aa333287989bee7 Mon Sep 17 00:00:00 2001 From: Jose Lamego Date: Tue, 4 Apr 2017 16:45:09 -0500 Subject: 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 Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- scripts/create-pull-request | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'scripts/create-pull-request') 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!" -- cgit v1.2.3-54-g00ecf