Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A11CA431FBC for ; Wed, 25 Nov 2009 10:01:55 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cGvr5Nbzu79S for ; Wed, 25 Nov 2009 10:01:55 -0800 (PST) Received: from mail-bw0-f224.google.com (mail-bw0-f224.google.com [209.85.218.224]) by olra.theworths.org (Postfix) with ESMTP id DAF57431FAE for ; Wed, 25 Nov 2009 10:01:54 -0800 (PST) Received: by bwz24 with SMTP id 24so6126486bwz.30 for ; Wed, 25 Nov 2009 10:01:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references; bh=nZ/y5xIvWj1QLyDMBDEisCWt3qSjS63dr+EcLt0j5nI=; b=XDWFqmvEEG25kcmlV2z3Sfi/9EFkUHc6nB4Q12OwNficvBTOh0Cc82dsgZmkNs0A+z o3Qp4MuYZLhNqh1zSqKrtVZ8ICUSO0DjbSoWjt68teODUt97SS+GI2rN7Ku//gMHw5og 0ZxnVk8LJlQAW38XK1MeDSYy1hgTV+D9Ayyxs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=H3gq0vL0+464pGY4myZrncBZD2yB028yQi9abKKSOB+BXekGBzGnUIJ2f2tihGVow2 cuvTnC6kYw5fVYFaMzIFDBfX7CbMSAoME/YxRzK67usrumvjJDKtjC/ugFQ5dSLbOiSc 9FBFHP8yUbWC8KYXGf8Z4wewpSOSI5hrAvnIs= Received: by 10.204.7.87 with SMTP id c23mr7792334bkc.97.1259172113731; Wed, 25 Nov 2009 10:01:53 -0800 (PST) Received: from localhost.localdomain (vawpc43.ethz.ch [129.132.59.11]) by mx.google.com with ESMTPS id k29sm8997651fkk.51.2009.11.25.10.01.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 25 Nov 2009 10:01:52 -0800 (PST) Sender: Jed Brown From: Jed Brown To: notmuch@notmuchmail.org Date: Wed, 25 Nov 2009 19:02:18 +0100 Message-Id: <1259172139-3274-1-git-send-email-jed@59A2.org> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: <1259112914-19806-2-git-send-email-jed@59A2.org> References: <1259112914-19806-2-git-send-email-jed@59A2.org> Subject: [notmuch] [PATCH 1/2] reply --format=headers-only: set In-Reply-To header, with ID *last* in References X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 18:01:55 -0000 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. --- notmuch-reply.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index e85568c..9ca1236 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); -- 1.6.5.3