--- /dev/null
+Return-Path: <xuwang762@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 9517D6DE0943\r
+ for <notmuch@notmuchmail.org>; Sun, 13 Sep 2015 08:10:10 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.575\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.575 tagged_above=-999 required=5\r
+ tests=[AWL=-0.005, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,\r
+ DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25,\r
+ FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,\r
+ RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id Hl6v9zx3tlni for <notmuch@notmuchmail.org>;\r
+ Sun, 13 Sep 2015 08:10:08 -0700 (PDT)\r
+Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com\r
+ [209.85.218.53])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id F39246DE0274\r
+ for <notmuch@notmuchmail.org>; Sun, 13 Sep 2015 08:10:07 -0700 (PDT)\r
+Received: by oixx17 with SMTP id x17so65198384oix.0\r
+ for <notmuch@notmuchmail.org>; Sun, 13 Sep 2015 08:10:06 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=mime-version:in-reply-to:references:date:message-id:subject:from:to\r
+ :content-type; bh=9/mpiUodtCmoGeVG968ev6gFmVxp6qWx7rk2hCComjY=;\r
+ b=RfU1SglHYi7O1d+KL1x/iAeMT2DJBFtvu1RWSmBS/Dzt1m/Q41RJovKignv+rQUUSe\r
+ 6DwZ772vc/ilPJzDgeMcwJyFKm3M4Iwc/StY5DqklanKkRQ78btYxhZF3pBldh29Eici\r
+ Jf8JlGqoWCPC4hCAZtUcRLJi/iRBGB7WssTqM+d6GwA6yFBjymcq8vCwjKqmWOUarGad\r
+ +Z4sfU+fIMa+dpBPMN6dXcQW4Bcrr5y5fXtAbpDITMVzatrxNpsKxPMB1sEE+TkNkLGa\r
+ HM9IO/eZ++D9ZBpbJByE08A36i7bZgn8MW6YMSMYAopfAHGUDdAGTmaZGWxXRYs4MaAr\r
+ 5wEA==\r
+MIME-Version: 1.0\r
+X-Received: by 10.202.232.12 with SMTP id f12mr6548863oih.122.1442157005826;\r
+ Sun, 13 Sep 2015 08:10:05 -0700 (PDT)\r
+Received: by 10.202.212.204 with HTTP; Sun, 13 Sep 2015 08:10:05 -0700 (PDT)\r
+In-Reply-To: <20150913061945.GD18353@chitra.no-ip.org>\r
+References:\r
+ <CAJhTkNh7_hXDLsAGyD7nwkXV4ca6ymkLtFG945USvfqK4ZJEdQ@mail.gmail.com>\r
+ <20150913061945.GD18353@chitra.no-ip.org>\r
+Date: Sun, 13 Sep 2015 11:10:05 -0400\r
+Message-ID:\r
+ <CAJhTkNi1ayRtYVgMq9Xsp-i=_tEDv29j+2PH+4-K4HA6+ezioA@mail.gmail.com>\r
+Subject: Re: Possible some threads are not complete due to bug?\r
+From: Xu Wang <xuwang762@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Content-Type: text/plain; charset=UTF-8\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 13 Sep 2015 15:10:10 -0000\r
+\r
+On Sun, Sep 13, 2015 at 2:19 AM, Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:\r
+> Hi,\r
+>\r
+> You should include a reference to the original message, not everyone\r
+> will remember the thread.\r
+>\r
+> id:20150614082258.GD17381@chitra.no-ip.org or\r
+> <http://mid.gmane.org/20150614082258.GD17381@chitra.no-ip.org>\r
+\r
+Ah yes thank you.\r
+\r
+> On Sun, Sep 13, 2015 at 12:03:20AM -0400, Xu Wang wrote:\r
+>>\r
+>> Sometimes I need to do:\r
+>>\r
+>> $ notmuch search --output=threads "id:MYMSGID"\r
+>> thread:000000000000a125\r
+>> $ notmuch search --output=messages "thread:000000000000a125"\r
+>\r
+> Looking at the script again, I see I assumed a message will belong to a\r
+> single thread. You can remove that assumption by applying the following\r
+> change.\r
+>\r
+> -----8<--------------------8<-----\r
+> diff -u nm-ack nm-ack\r
+> --- nm-ack 2015-06-15 01:30:40.327556510 +0200\r
+> +++ nm-ack 2015-09-13 07:58:30.734096931 +0200\r
+> @@ -10,8 +10,9 @@\r
+> # debug\r
+> # set -o xtrace\r
+>\r
+> -declare query="$1" thread=$(notmuch search --output=threads -- "$1")\r
+> -declare -a msgs=$(notmuch search --output=messages -- "$thread") responses\r
+> +declare query="$1"\r
+> +declare -a thread=$(notmuch search --output=threads -- "$1")\r
+> +declare -a msgs=$(notmuch search --output=messages -- "${thread[@]}") responses\r
+>\r
+> function strip_mid() {\r
+> sed -e 's/ \+//g' -e 's/<\([^ <>]\+\)>/\1/g'\r
+> ----->8-------------------->8-----\r
+>\r
+>> In theory, this should output the message that responded to message ID\r
+>> "MYMSGID". Sometimes it works. But sometimes it does not work. That\r
+>> is, there exists an email where I am sure (I checked the raw email)\r
+>> that there is a header\r
+>> In-Reply-To: <MYMSGID>\r
+>> but that email does not show when I do the two commands above.\r
+>> Indeed, that mail belongs to a different thread ID.\r
+>>\r
+>> I am just curious if the above is due to:\r
+>>\r
+>> 1. My missing of understanding of how notmuch deals with threads\r
+>> 2. A bug or missing feature in notmuch causes some threads to be incomplete\r
+>\r
+> Interesting issue. I can think of a case, say a message is cross-posted\r
+> to multiple lists, it might then give you more than one thread ids. Is\r
+> this the case for your message? If you are up for it, look in\r
+> lib/thread.cc. I think the relevant methods are:\r
+> _resolve_thread_relationships and _notmuch_thread_create, but I could be\r
+> wrong. I'm not familiar with the notmuch source.\r
+>\r
+> As I recall, you are using mutt-kz; does <entire-thread> work from\r
+> mutt-kz? I would expect that to fail too. It gets the thread id like\r
+> this:\r
+>\r
+> id = notmuch_message_get_thread_id(msg);\r
+>\r
+> Hope this helps,\r
+\r
+Thanks so very much as always Suvayu. I learn a great amount of\r
+knowledge from you.\r
+I tried the fixes and nothing changed. The message IDs had different\r
+threads. <entire-thread> did not work in mutt-kz. However, when I\r
+viewed [all mail] (from Gmail) so that the messages were in the same\r
+mailbox, mutt recognized they were a thread (in the sense of the\r
+down-right arrow signifying a reply).\r
+\r
+In the end, I removed the .notmuch folder and ran 'notmuch new' to\r
+regenerate everything. This worked! However I am wondering why I had\r
+to do that. Is there any case where doing a complete refresh should be\r
+done as opposed to "notmuch new" (which I do all the time)?\r
+It appears that thread detection works different when adding messages\r
+as opposed to a complete refresh?\r
+\r
+Kind regards,\r
+\r
+Xu\r
+\r
+> --\r
+> Suvayu\r
+>\r
+> Open source is the future. It sets us free.\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r