@matheusbsbs / matheus-bagliano / commits / 2175c10d5a
Fork 0

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>

Thomas Rast committed Feb 19, 2009 at 22:26 UTC 2175c10d5ad2769936f5bf5bcca5ea32715a7307
2 files changed +21 -8
builtin-log.c
+15 -5
@@ -1036,12 +1036,22 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1036 /* Have we already had a message ID? */
1037 if (rev.message_id) {
1038 /*
1039 - * If we've got the ID to be a reply
1040 - * to, discard the current ID;
1041 - * otherwise, make everything a reply
1042 - * to that.
1039 + * Without --cover-letter and
1040 + * --in-reply-to, make every mail a
1041 + * reply to the one before.
1042 + *
1043 + * With --in-reply-to but no
1044 + * --cover-letter, make every mail a
1045 + * reply to the <reply-to>.
1046 + *
1047 + * With --cover-letter, make every
1048 + * mail but the cover letter a reply
1049 + * to the cover letter. The cover
1050 + * letter is a reply to the
1051 + * --in-reply-to, if specified.
1052 */
1044 - if (rev.ref_message_ids->nr > 0)
1053 + if (rev.ref_message_ids->nr > 0
1054 + && (!cover_letter || rev.nr > 1))
1055 free(rev.message_id);
1056 else
1057 string_list_append(rev.message_id,
t/t4014-format-patch.sh
+6 -3
@@ -237,16 +237,19 @@ In-Reply-To: <1>
237 References: <1>
238 ---
239 Message-Id: <2>
240 -In-Reply-To: <1>
240 +In-Reply-To: <0>
241 References: <1>
242 + <0>
243 ---
244 Message-Id: <3>
244 -In-Reply-To: <1>
245 +In-Reply-To: <0>
246 References: <1>
247 + <0>
248 ---
249 Message-Id: <4>
248 -In-Reply-To: <1>
250 +In-Reply-To: <0>
251 References: <1>
252 + <0>
253 EOF
254
255 test_expect_success 'thread cover-letter in-reply-to' '