diff options
author | Jed Brown <jed@59A2.org> | 2009-11-25 19:02:18 +0100 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2009-11-27 16:56:51 -0800 |
commit | 00b138ba2ac0c9a01f19d9e0b75657f1082a766d (patch) | |
tree | 7c97911c07931e4c33682f46c59838b38489a15f /notmuch-reply.c | |
parent | f47e54bc515599486eff34642a7f340626c57197 (diff) |
reply --format=headers-only: set In-Reply-To header, with ID *last* in References
Apparently this is actually the correct way to do it, it's silly to do
it wrong just to conform to one of git's internal data structures.
Diffstat (limited to 'notmuch-reply.c')
-rw-r--r-- | notmuch-reply.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/notmuch-reply.c b/notmuch-reply.c index e85568c0..9ca1236b 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -310,15 +310,19 @@ notmuch_reply_format_headers_only(void *ctx, notmuch_config_t *config, notmuch_q in_reply_to = talloc_asprintf (ctx, "<%s>", notmuch_message_get_message_id (message)); + g_mime_object_set_header (GMIME_OBJECT (reply), + "In-Reply-To", in_reply_to); + + orig_references = notmuch_message_get_header (message, "references"); - /* We print References first because git format-patch treats it specially. - * Git uses the first entry of References to create In-Reply-To. + /* We print In-Reply-To followed by References because git format-patch treats them + * specially. Git does not interpret the other headers specially */ references = talloc_asprintf (ctx, "%s%s%s", - in_reply_to, orig_references ? orig_references : "", - orig_references ? " " : ""); + orig_references ? " " : "", + in_reply_to); g_mime_object_set_header (GMIME_OBJECT (reply), "References", references); |