format-patch: thread as reply to cover letter even with in-reply-to
Currently, format-patch --thread --cover-letter --in-reply-to $parent makes all mails, including the cover letter, a reply to $parent. However, we would want the reader to consider the cover letter above all the patches. This changes the semantics so that only the cover letter is a reply to $parent, while all the patches are formatted as replies to the cover letter. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
b079c50e03
commit
2175c10d5a
@ -1036,12 +1036,22 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
|
|||||||
/* Have we already had a message ID? */
|
/* Have we already had a message ID? */
|
||||||
if (rev.message_id) {
|
if (rev.message_id) {
|
||||||
/*
|
/*
|
||||||
* If we've got the ID to be a reply
|
* Without --cover-letter and
|
||||||
* to, discard the current ID;
|
* --in-reply-to, make every mail a
|
||||||
* otherwise, make everything a reply
|
* reply to the one before.
|
||||||
* to that.
|
*
|
||||||
|
* With --in-reply-to but no
|
||||||
|
* --cover-letter, make every mail a
|
||||||
|
* reply to the <reply-to>.
|
||||||
|
*
|
||||||
|
* With --cover-letter, make every
|
||||||
|
* mail but the cover letter a reply
|
||||||
|
* to the cover letter. The cover
|
||||||
|
* letter is a reply to the
|
||||||
|
* --in-reply-to, if specified.
|
||||||
*/
|
*/
|
||||||
if (rev.ref_message_ids->nr > 0)
|
if (rev.ref_message_ids->nr > 0
|
||||||
|
&& (!cover_letter || rev.nr > 1))
|
||||||
free(rev.message_id);
|
free(rev.message_id);
|
||||||
else
|
else
|
||||||
string_list_append(rev.message_id,
|
string_list_append(rev.message_id,
|
||||||
|
@ -237,16 +237,19 @@ In-Reply-To: <1>
|
|||||||
References: <1>
|
References: <1>
|
||||||
---
|
---
|
||||||
Message-Id: <2>
|
Message-Id: <2>
|
||||||
In-Reply-To: <1>
|
In-Reply-To: <0>
|
||||||
References: <1>
|
References: <1>
|
||||||
|
<0>
|
||||||
---
|
---
|
||||||
Message-Id: <3>
|
Message-Id: <3>
|
||||||
In-Reply-To: <1>
|
In-Reply-To: <0>
|
||||||
References: <1>
|
References: <1>
|
||||||
|
<0>
|
||||||
---
|
---
|
||||||
Message-Id: <4>
|
Message-Id: <4>
|
||||||
In-Reply-To: <1>
|
In-Reply-To: <0>
|
||||||
References: <1>
|
References: <1>
|
||||||
|
<0>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
test_expect_success 'thread cover-letter in-reply-to' '
|
test_expect_success 'thread cover-letter in-reply-to' '
|
||||||
|
Reference in New Issue
Block a user