Re: [notmuch] [PATCH] Make the date parser nicer
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Fri, 22 Jan 2010 15:33:12 +0000 (16:33 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:01 +0000 (09:36 -0800)
96/0c0343bd43cd854e7d29e37134e43d43d96efa [new file with mode: 0644]

diff --git a/96/0c0343bd43cd854e7d29e37134e43d43d96efa b/96/0c0343bd43cd854e7d29e37134e43d43d96efa
new file mode 100644 (file)
index 0000000..25267a5
--- /dev/null
@@ -0,0 +1,72 @@
+Return-Path: <Sebastian@SSpaeth.de>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id A25DA431FBC\r
+       for <notmuch@notmuchmail.org>; Fri, 22 Jan 2010 07:33:17 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.107\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.107 tagged_above=-999 required=5 tests=[AWL=0.106, \r
+       BAYES_50=0.001] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id A96G5dMqg093 for <notmuch@notmuchmail.org>;\r
+       Fri, 22 Jan 2010 07:33:17 -0800 (PST)\r
+Received: from homiemail-a25.g.dreamhost.com (caiajhbdcaib.dreamhost.com\r
+       [208.97.132.81])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1321D431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 22 Jan 2010 07:33:17 -0800 (PST)\r
+Received: from sspaeth.de (unknown [84.55.198.58])\r
+       by homiemail-a25.g.dreamhost.com (Postfix) with ESMTPA id 246AC678071; \r
+       Fri, 22 Jan 2010 07:33:14 -0800 (PST)\r
+Received: by sspaeth.de (sSMTP sendmail emulation);\r
+       Fri, 22 Jan 2010 16:33:12 +0100\r
+From: "Sebastian Spaeth" <Sebastian@SSpaeth.de>\r
+To: notmuch@notmuchmail.org\r
+In-Reply-To: <1264173971-11879-1-git-send-email-Sebastian@SSpaeth.de>\r
+References: <1264173971-11879-1-git-send-email-Sebastian@SSpaeth.de>\r
+Date: Fri, 22 Jan 2010 16:33:12 +0100\r
+Message-ID: <87ockmjgsn.fsf@SSpaeth.de>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Subject: Re: [notmuch] [PATCH] Make the date parser nicer\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\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: Fri, 22 Jan 2010 15:33:17 -0000\r
+\r
+\r
+Please find in the previous mail attached my patch (against my current\r
+all-feature branch, but should pretty much apply to current master too).\r
+It is a proof-of-concept to make the date parser nicer. The following \r
+searches work with this code:\r
+\r
+notmuch show...\r
+... date:2001..2010 (from beginning of 2001 until end of 2010)\r
+... date:20011201..200506 (from 1001-12-01 until 2005-06-31\r
+\r
+The code will pretty surely need some cleaning up, as I can hardly code\r
+C, not to speak of C++. But at least it works and it is not very\r
+intrusive.\r
+\r
+(Ps. now that I think of it, I always use day 31 as last day, which is\r
+surely wrong, it also still accepts some obviously wrong dates like\r
+20040231)\r
+\r
+We could also think about using a xapian DateValueRangeParser to do\r
+that, but that would require saving the timestamp as YYYYMMDD in the\r
+database (which we probably do not want).\r
+\r
+Feedback welcome,\r
+Sebastian\r