From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 28102431FD0 for ; Sun, 3 Jul 2011 23:52:28 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled 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 g0d0JA7ln5Mr for ; Sun, 3 Jul 2011 23:52:27 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 25473431FB6 for ; Sun, 3 Jul 2011 23:52:26 -0700 (PDT) Received: by wyh22 with SMTP id 22so3733696wyh.26 for ; Sun, 03 Jul 2011 23:52:25 -0700 (PDT) Received: by 10.227.19.206 with SMTP id c14mr5109303wbb.0.1309762345479; Sun, 03 Jul 2011 23:52:25 -0700 (PDT) Received: from localhost ([109.131.160.67]) by mx.google.com with ESMTPS id e11sm2019848wbh.19.2011.07.03.23.52.23 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jul 2011 23:52:23 -0700 (PDT) From: Pieter Praet To: Austin Clements Subject: [PROTO] possible solution for "Race condition for '*' command" Date: Mon, 4 Jul 2011 08:51:53 +0200 Message-Id: <1309762318-4530-1-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <20110703171743.GL15901@mit.edu> References: <20110703171743.GL15901@mit.edu> Cc: Notmuch Mail X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Mon, 04 Jul 2011 06:52:28 -0000 Thanks Austin! Unfortunately, your patch causes *all* Message-Id's in the thread to be appended, as opposed to only the ones matching the query: #+BEGIN_EXAMPLE $ notmuch search tag:inbox AND from:amdragon@mit.edu thread:0000000000002777 Yest. 19:17 [1/3] Austin Clements| Pieter Praet; [PATCH 2/2] [RFC] possible solution for "Race condition for '*' command" (inbox replied sent to-me x/notmuch) id:"CAH-f9WticM4EN8F1_ik_-mcBcBtrXwSpO+Drbtp7=UN7McECrg@mail.gmail.com" or id:"87zkkwydag.fsf@praet.org" or id:"20110703171743.GL15901@mit.edu" #+END_EXAMPLE As you can see, according to matched/total ("[1/3]") only a single message matches the query, yet all 3 MsgId's are returned. If this were to be corrected (probably a trivial change, but I'm pretty much oblivious as to the what and where of it), the following patch series should work as intended. The "--stdin" option works as expected (and ARG_MAX is indeed a very valid concern with this particular use case), but I haven't yet gotten around to making use of it from the Emacs UI as this would require some screwing around with `notmuch-tag' and `notmuch-call-notmuch-process', and it's still pretty early I-). Peace -- Pieter