From: Austin Clements Date: Mon, 22 Sep 2014 15:06:07 +0000 (+0000) Subject: Re: Do path: searches handle spaces correctly? X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bcb7071750bccf700687c59b2d01cccee6a0afb2;p=notmuch-archives.git Re: Do path: searches handle spaces correctly? --- diff --git a/20/f9f587871344795b2003028166cc659334b754 b/20/f9f587871344795b2003028166cc659334b754 new file mode 100644 index 000000000..4132fc9f2 --- /dev/null +++ b/20/f9f587871344795b2003028166cc659334b754 @@ -0,0 +1,92 @@ +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 158B4431FC0 + for ; Mon, 22 Sep 2014 08:06:15 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] 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 GU-HI0lTHCn7 for ; + Mon, 22 Sep 2014 08:06:10 -0700 (PDT) +Received: from outgoing.csail.mit.edu (outgoing.csail.mit.edu [128.30.2.149]) + by olra.theworths.org (Postfix) with ESMTP id E2287431FB6 + for ; Mon, 22 Sep 2014 08:06:10 -0700 (PDT) +Received: from [104.131.20.129] (helo=awakeningjr) + by outgoing.csail.mit.edu with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.72) (envelope-from ) + id 1XW5Bo-0005xt-JK; Mon, 22 Sep 2014 11:06:08 -0400 +Received: from amthrax by awakeningjr with local (Exim 4.84) + (envelope-from ) + id 1XW5Bn-0005uR-PB; Mon, 22 Sep 2014 15:06:07 +0000 +Date: Mon, 22 Sep 2014 15:06:07 +0000 +From: Austin Clements +To: Keith Amidon +Subject: Re: Do path: searches handle spaces correctly? +Message-ID: <20140922150607.GA7970@csail.mit.edu> +References: <878uleklvt.fsf@awakenetworks.com> + <87tx40ggf1.fsf@maritornes.cs.unb.ca> + <1411396931.1931.91.camel@picnicpark.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1411396931.1931.91.camel@picnicpark.org> +User-Agent: Mutt/1.5.23 (2014-03-12) +Cc: notmuch@notmuchmail.org +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, 22 Sep 2014 15:06:15 -0000 + +Quoth Keith Amidon on Sep 22 at 7:42 am: +> On Mon, 2014-09-22 at 11:20 +0200, David Bremner wrote: +> > Keith Amidon writes: +> > > +> > > notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items' +> > > +> > > I don't get any results, but it seems like the two results above should +> > > be shown, right? Am I doing something wrong here? If it looks like I'm +> > > doing it correctly, what can I do to help troubleshoot the issue? +> > +> > Note that path:, unlike folder:, does not add the maildir subdirs. Dunno +> > if that's the only issue you are having, but I guess it's one. +> +> Darn it! I made a mistake in my original email. In the test I was +> doing I actually had: +> +> notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items/**' +> +> which I believe should have picked up all the subdirectory paths. I +> just retested to make sure that it still didn't work, and it doesn't. +> +> Am I still missing something? Thanks for the help, Keith + +I assume you're doing this from the command line? Does the following +work? + +notmuch search --output=files 'path:"dir/INBOX/INBOX/Sent Items/**"' + +Shell quoting and Xapian quoting interact in often confusing ways. In +your original command line, the single quotes suppress shell argument +splitting, but never make it to notmuch, so notmuch sees two search +terms "path:dir/INBOX/INBOX/Sent" and "Items/**". In the command line +I suggested, the single quotes play the same role, but for the entire +query. Because of the quoting, notmuch *does* see the inner double +quotes, which makes the path a single term (note that Xapian only +accepts double quotes, not single quotes). In general, it's good to +enclose the entire command line query in single quotes so shell +parsing doesn't get in the way of query parsing.