* [PATCH] create-pull-request: add "-t in-reply-to" option
@ 2017-04-04 21:45 Jose Lamego
2017-04-05 14:00 ` Leonardo Sandoval
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Jose Lamego @ 2017-04-04 21:45 UTC (permalink / raw)
To: openembedded-core
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 <jose.a.lamego@linux.intel.com>
---
scripts/create-pull-request | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index e82858b..46d6538 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -34,7 +34,7 @@ RFC=0
usage() {
CMD=$(basename $0)
cat <<EOM
-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]
+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]
-b branch Branch name in the specified remote (default: current branch)
-l local branch Local branch name (default: HEAD)
-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
-s subject The subject to be inserted into the summary email
-u remote The git remote where the branch is located, or set CPR_CONTRIB_REMOTE in env
-d relative_dir Generate patches relative to directory
+ -t in_reply_to Make mails appear as replies to the given Message-Id, to continue patch/series threads
Examples:
$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
$CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc
$CMD -u contrib -p "RFC PATCH" -b nitin/experimental
$CMD -u contrib -i misc -b nitin/misc -d ./bitbake
+ $CMD -u contrib -p "OE-core][PATCH v2" -t "<cover.11146.git.john.doe@example.com>"
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!"
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] create-pull-request: add "-t in-reply-to" option
2017-04-04 21:45 [PATCH] create-pull-request: add "-t in-reply-to" option Jose Lamego
@ 2017-04-05 14:00 ` Leonardo Sandoval
2017-04-05 19:35 ` Jose Lamego
2017-04-05 19:29 ` [patchwork][PATCH v2] " Jose Lamego
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Leonardo Sandoval @ 2017-04-05 14:00 UTC (permalink / raw)
To: Jose Lamego; +Cc: openembedded-core
On Tue, 2017-04-04 at 16:45 -0500, Jose Lamego wrote:
> The create-patch-request script creates patches as replies to a cover
you mean create-pull-request, I believe
> 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.
>
BTW, is there an easy way to get the in-reply-to email besides using
git-pw or looking at the message source?
Some comments in patch:
> [YOCTO #11294]
>
> Signed-off-by: Jose Lamego <jose.a.lamego@linux.intel.com>
> ---
> scripts/create-pull-request | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/create-pull-request b/scripts/create-pull-request
> index e82858b..46d6538 100755
> --- a/scripts/create-pull-request
> +++ b/scripts/create-pull-request
> @@ -34,7 +34,7 @@ RFC=0
> usage() {
> CMD=$(basename $0)
> cat <<EOM
> -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]
> +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]
> -b branch Branch name in the specified remote (default: current branch)
> -l local branch Local branch name (default: HEAD)
> -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
> -s subject The subject to be inserted into the summary email
> -u remote The git remote where the branch is located, or set CPR_CONTRIB_REMOTE in env
> -d relative_dir Generate patches relative to directory
> + -t in_reply_to Make mails appear as replies to the given Message-Id, to continue patch/series threads
>
> Examples:
> $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
> $CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc
> $CMD -u contrib -p "RFC PATCH" -b nitin/experimental
> $CMD -u contrib -i misc -b nitin/misc -d ./bitbake
> + $CMD -u contrib -p "OE-core][PATCH v2" -t "<cover.11146.git.john.doe@example.com>"
> 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"
it would be nice to include also the double semi-colon, so future cases
just start after it.
> 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
-n instead of -z?
> + 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!"
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [patchwork][PATCH v2] create-pull-request: add "-t in-reply-to" option
2017-04-04 21:45 [PATCH] create-pull-request: add "-t in-reply-to" option Jose Lamego
2017-04-05 14:00 ` Leonardo Sandoval
@ 2017-04-05 19:29 ` Jose Lamego
2017-04-05 19:36 ` [yocto][patchwork][PATCH " Jose Lamego
2017-04-05 19:38 ` [PATCH " Jose Lamego
3 siblings, 0 replies; 8+ messages in thread
From: Jose Lamego @ 2017-04-05 19:29 UTC (permalink / raw)
To: yocto
The create-pull-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 <jose.a.lamego@linux.intel.com>
---
scripts/create-pull-request | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index e82858b..8f0be99 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -34,7 +34,7 @@ RFC=0
usage() {
CMD=$(basename $0)
cat <<EOM
-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]
+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]
-b branch Branch name in the specified remote (default: current branch)
-l local branch Local branch name (default: HEAD)
-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
-s subject The subject to be inserted into the summary email
-u remote The git remote where the branch is located, or set CPR_CONTRIB_REMOTE in env
-d relative_dir Generate patches relative to directory
+ -t in_reply_to Make mails appear as replies to the given Message-Id, to continue patch/series threads
Examples:
$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
$CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc
$CMD -u contrib -p "RFC PATCH" -b nitin/experimental
$CMD -u contrib -i misc -b nitin/misc -d ./bitbake
+ $CMD -u contrib -p "OE-core][PATCH v2" -t "<cover.11146.git.john.doe@example.com>"
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,7 +110,10 @@ while getopts "b:acd:hi:m:o:p:r:s:u:l:" OPT; do
a)
CPR_CONTRIB_AUTO_PUSH="1"
;;
- esac
+ t)
+ IN_REPLY_TO="$OPTARG"
+ ;;
+ esac
done
if [ -z "$REMOTE" ]; then
@@ -205,7 +210,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 [ -n "$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!"
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] create-pull-request: add "-t in-reply-to" option
2017-04-05 14:00 ` Leonardo Sandoval
@ 2017-04-05 19:35 ` Jose Lamego
0 siblings, 0 replies; 8+ messages in thread
From: Jose Lamego @ 2017-04-05 19:35 UTC (permalink / raw)
To: Leonardo Sandoval; +Cc: openembedded-core
[-- Attachment #1.1: Type: text/plain, Size: 4450 bytes --]
On 04/05/2017 09:00 AM, Leonardo Sandoval wrote:
> On Tue, 2017-04-04 at 16:45 -0500, Jose Lamego wrote:
>> The create-patch-request script creates patches as replies to a cover
>
> you mean create-pull-request, I believe
>
>> 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.
>>
>
>
> BTW, is there an easy way to get the in-reply-to email besides using
> git-pw or looking at the message source?
That's a good question, I actually don't know of an easier way of
knowing the Message-Id. Will further investigate.
>
> Some comments in patch:
>
Thanks Leo!
>
>
>
>> [YOCTO #11294]
>>
>> Signed-off-by: Jose Lamego <jose.a.lamego@linux.intel.com>
>> ---
>> scripts/create-pull-request | 14 +++++++++++---
>> 1 file changed, 11 insertions(+), 3 deletions(-)
>>
>> diff --git a/scripts/create-pull-request b/scripts/create-pull-request
>> index e82858b..46d6538 100755
>> --- a/scripts/create-pull-request
>> +++ b/scripts/create-pull-request
>> @@ -34,7 +34,7 @@ RFC=0
>> usage() {
>> CMD=$(basename $0)
>> cat <<EOM
>> -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]
>> +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]
>> -b branch Branch name in the specified remote (default: current branch)
>> -l local branch Local branch name (default: HEAD)
>> -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
>> -s subject The subject to be inserted into the summary email
>> -u remote The git remote where the branch is located, or set CPR_CONTRIB_REMOTE in env
>> -d relative_dir Generate patches relative to directory
>> + -t in_reply_to Make mails appear as replies to the given Message-Id, to continue patch/series threads
>>
>> Examples:
>> $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
>> $CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc
>> $CMD -u contrib -p "RFC PATCH" -b nitin/experimental
>> $CMD -u contrib -i misc -b nitin/misc -d ./bitbake
>> + $CMD -u contrib -p "OE-core][PATCH v2" -t "<cover.11146.git.john.doe@example.com>"
>> 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"
>
> it would be nice to include also the double semi-colon, so future cases
> just start after it.
>
done in v2 patch.
>
>> 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
>
> -n instead of -z?
>
also done in v2 patch
>> + 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!"
>> --
>> 2.7.4
>>
>
>
--
Jose Lamego | OTC Embedded Platforms & Tools | GDC
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 484 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [yocto][patchwork][PATCH v2] create-pull-request: add "-t in-reply-to" option
2017-04-04 21:45 [PATCH] create-pull-request: add "-t in-reply-to" option Jose Lamego
2017-04-05 14:00 ` Leonardo Sandoval
2017-04-05 19:29 ` [patchwork][PATCH v2] " Jose Lamego
@ 2017-04-05 19:36 ` Jose Lamego
2017-04-05 19:38 ` [PATCH " Jose Lamego
3 siblings, 0 replies; 8+ messages in thread
From: Jose Lamego @ 2017-04-05 19:36 UTC (permalink / raw)
To: openembedded-core
The create-pull-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 <jose.a.lamego@linux.intel.com>
---
scripts/create-pull-request | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index e82858b..8f0be99 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -34,7 +34,7 @@ RFC=0
usage() {
CMD=$(basename $0)
cat <<EOM
-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]
+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]
-b branch Branch name in the specified remote (default: current branch)
-l local branch Local branch name (default: HEAD)
-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
-s subject The subject to be inserted into the summary email
-u remote The git remote where the branch is located, or set CPR_CONTRIB_REMOTE in env
-d relative_dir Generate patches relative to directory
+ -t in_reply_to Make mails appear as replies to the given Message-Id, to continue patch/series threads
Examples:
$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
$CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc
$CMD -u contrib -p "RFC PATCH" -b nitin/experimental
$CMD -u contrib -i misc -b nitin/misc -d ./bitbake
+ $CMD -u contrib -p "OE-core][PATCH v2" -t "<cover.11146.git.john.doe@example.com>"
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,7 +110,10 @@ while getopts "b:acd:hi:m:o:p:r:s:u:l:" OPT; do
a)
CPR_CONTRIB_AUTO_PUSH="1"
;;
- esac
+ t)
+ IN_REPLY_TO="$OPTARG"
+ ;;
+ esac
done
if [ -z "$REMOTE" ]; then
@@ -205,7 +210,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 [ -n "$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!"
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2] create-pull-request: add "-t in-reply-to" option
2017-04-04 21:45 [PATCH] create-pull-request: add "-t in-reply-to" option Jose Lamego
` (2 preceding siblings ...)
2017-04-05 19:36 ` [yocto][patchwork][PATCH " Jose Lamego
@ 2017-04-05 19:38 ` Jose Lamego
2017-05-12 21:18 ` Christopher Larson
3 siblings, 1 reply; 8+ messages in thread
From: Jose Lamego @ 2017-04-05 19:38 UTC (permalink / raw)
To: openembedded-core
The create-pull-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 <jose.a.lamego@linux.intel.com>
---
scripts/create-pull-request | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index e82858b..8f0be99 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -34,7 +34,7 @@ RFC=0
usage() {
CMD=$(basename $0)
cat <<EOM
-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]
+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]
-b branch Branch name in the specified remote (default: current branch)
-l local branch Local branch name (default: HEAD)
-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
-s subject The subject to be inserted into the summary email
-u remote The git remote where the branch is located, or set CPR_CONTRIB_REMOTE in env
-d relative_dir Generate patches relative to directory
+ -t in_reply_to Make mails appear as replies to the given Message-Id, to continue patch/series threads
Examples:
$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
$CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc
$CMD -u contrib -p "RFC PATCH" -b nitin/experimental
$CMD -u contrib -i misc -b nitin/misc -d ./bitbake
+ $CMD -u contrib -p "OE-core][PATCH v2" -t "<cover.11146.git.john.doe@example.com>"
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,7 +110,10 @@ while getopts "b:acd:hi:m:o:p:r:s:u:l:" OPT; do
a)
CPR_CONTRIB_AUTO_PUSH="1"
;;
- esac
+ t)
+ IN_REPLY_TO="$OPTARG"
+ ;;
+ esac
done
if [ -z "$REMOTE" ]; then
@@ -205,7 +210,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 [ -n "$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!"
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2] create-pull-request: add "-t in-reply-to" option
2017-04-05 19:38 ` [PATCH " Jose Lamego
@ 2017-05-12 21:18 ` Christopher Larson
2017-05-15 19:28 ` Jose Lamego
0 siblings, 1 reply; 8+ messages in thread
From: Christopher Larson @ 2017-05-12 21:18 UTC (permalink / raw)
To: Jose Lamego; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 4380 bytes --]
Looks like the earlier version of this with the wrong -z vs -n got merged,
please submit a follow-up patch to fix it.
On Wed, Apr 5, 2017 at 12:38 PM, Jose Lamego <jose.a.lamego@linux.intel.com>
wrote:
> The create-pull-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 <jose.a.lamego@linux.intel.com>
> ---
> scripts/create-pull-request | 17 +++++++++++++----
> 1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/create-pull-request b/scripts/create-pull-request
> index e82858b..8f0be99 100755
> --- a/scripts/create-pull-request
> +++ b/scripts/create-pull-request
> @@ -34,7 +34,7 @@ RFC=0
> usage() {
> CMD=$(basename $0)
> cat <<EOM
> -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]
> +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]
> -b branch Branch name in the specified remote (default:
> current branch)
> -l local branch Local branch name (default: HEAD)
> -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
> -s subject The subject to be inserted into the summary email
> -u remote The git remote where the branch is located, or set
> CPR_CONTRIB_REMOTE in env
> -d relative_dir Generate patches relative to directory
> + -t in_reply_to Make mails appear as replies to the given
> Message-Id, to continue patch/series threads
>
> Examples:
> $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
> $CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc
> $CMD -u contrib -p "RFC PATCH" -b nitin/experimental
> $CMD -u contrib -i misc -b nitin/misc -d ./bitbake
> + $CMD -u contrib -p "OE-core][PATCH v2" -t "<cover.11146.git.john.doe@
> example.com>"
> 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,7 +110,10 @@ while getopts "b:acd:hi:m:o:p:r:s:u:l:" OPT; do
> a)
> CPR_CONTRIB_AUTO_PUSH="1"
> ;;
> - esac
> + t)
> + IN_REPLY_TO="$OPTARG"
> + ;;
> + esac
> done
>
> if [ -z "$REMOTE" ]; then
> @@ -205,7 +210,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 [ -n "$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!"
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
--
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics
[-- Attachment #2: Type: text/html, Size: 5842 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] create-pull-request: add "-t in-reply-to" option
2017-05-12 21:18 ` Christopher Larson
@ 2017-05-15 19:28 ` Jose Lamego
0 siblings, 0 replies; 8+ messages in thread
From: Jose Lamego @ 2017-05-15 19:28 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
[-- Attachment #1.1: Type: text/plain, Size: 5529 bytes --]
On 05/12/2017 04:18 PM, Christopher Larson wrote:
> Looks like the earlier version of this with the wrong -z vs -n got
> merged, please submit a follow-up patch to fix it.
>
Markus Lehtonen already sent a fix for the -n validation in
http://lists.openembedded.org/pipermail/openembedded-core/2017-May/136648.html
however, I've sent an additional patch that fixes the alternatives case
construct syntax in
http://lists.openembedded.org/pipermail/openembedded-core/2017-May/136699.html
Thanks for the heads up.
> On Wed, Apr 5, 2017 at 12:38 PM, Jose Lamego
> <jose.a.lamego@linux.intel.com <mailto:jose.a.lamego@linux.intel.com>>
> wrote:
>
> The create-pull-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 <jose.a.lamego@linux.intel.com
> <mailto:jose.a.lamego@linux.intel.com>>
> ---
> scripts/create-pull-request | 17 +++++++++++++----
> 1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/create-pull-request b/scripts/create-pull-request
> index e82858b..8f0be99 100755
> --- a/scripts/create-pull-request
> +++ b/scripts/create-pull-request
> @@ -34,7 +34,7 @@ RFC=0
> usage() {
> CMD=$(basename $0)
> cat <<EOM
> -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]
> +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]
> -b branch Branch name in the specified remote (default:
> current branch)
> -l local branch Local branch name (default: HEAD)
> -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
> -s subject The subject to be inserted into the summary email
> -u remote The git remote where the branch is located,
> or set CPR_CONTRIB_REMOTE in env
> -d relative_dir Generate patches relative to directory
> + -t in_reply_to Make mails appear as replies to the given
> Message-Id, to continue patch/series threads
>
> Examples:
> $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
> $CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc
> $CMD -u contrib -p "RFC PATCH" -b nitin/experimental
> $CMD -u contrib -i misc -b nitin/misc -d ./bitbake
> + $CMD -u contrib -p "OE-core][PATCH v2" -t
> "<cover.11146.git.john.doe@example.com
> <mailto:cover.11146.git.john.doe@example.com>>"
> 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,7 +110,10 @@ while getopts "b:acd:hi:m:o:p:r:s:u:l:" OPT; do
> a)
> CPR_CONTRIB_AUTO_PUSH="1"
> ;;
> - esac
> + t)
> + IN_REPLY_TO="$OPTARG"
> + ;;
> + esac
> done
>
> if [ -z "$REMOTE" ]; then
> @@ -205,7 +210,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 [ -n "$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!"
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> <mailto:Openembedded-core@lists.openembedded.org>
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
> <http://lists.openembedded.org/mailman/listinfo/openembedded-core>
>
>
>
>
> --
> Christopher Larson
> kergoth at gmail dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Senior Software Engineer, Mentor Graphics
--
Jose Lamego | OTC Embedded Platforms & Tools | GDC
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 484 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-05-15 19:28 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-04 21:45 [PATCH] create-pull-request: add "-t in-reply-to" option Jose Lamego
2017-04-05 14:00 ` Leonardo Sandoval
2017-04-05 19:35 ` Jose Lamego
2017-04-05 19:29 ` [patchwork][PATCH v2] " Jose Lamego
2017-04-05 19:36 ` [yocto][patchwork][PATCH " Jose Lamego
2017-04-05 19:38 ` [PATCH " Jose Lamego
2017-05-12 21:18 ` Christopher Larson
2017-05-15 19:28 ` Jose Lamego
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.