Re: [PATCH v3 6/9] lib: add date range query support
authorTomi Ollila <tomi.ollila@iki.fi>
Mon, 17 Sep 2012 15:35:58 +0000 (18:35 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:32 +0000 (09:49 -0800)
79/87b833c5f0625afba619292a2d4cff45980dc1 [new file with mode: 0644]

diff --git a/79/87b833c5f0625afba619292a2d4cff45980dc1 b/79/87b833c5f0625afba619292a2d4cff45980dc1
new file mode 100644 (file)
index 0000000..9e84a18
--- /dev/null
@@ -0,0 +1,120 @@
+Return-Path: <tomi.ollila@iki.fi>\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 C69E5431FAF\r
+       for <notmuch@notmuchmail.org>; Mon, 17 Sep 2012 08:35:54 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\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 UQwwJEmq8oQX for <notmuch@notmuchmail.org>;\r
+       Mon, 17 Sep 2012 08:35:54 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id EC6D3431FAE\r
+       for <notmuch@notmuchmail.org>; Mon, 17 Sep 2012 08:35:53 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+       by guru.guru-group.fi (Postfix) with ESMTP id 191CF10014F;\r
+       Mon, 17 Sep 2012 18:35:59 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Michal Nazarewicz <mina86@mina86.com>, David Bremner <david@tethera.net>,\r
+       Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v3 6/9] lib: add date range query support\r
+In-Reply-To: <xa1tipbczo68.fsf@mina86.com>\r
+References: <cover.1347484177.git.jani@nikula.org>\r
+       <532340d05ea748518c021048900bb83149e04e88.1347484177.git.jani@nikula.org>\r
+       <xa1tsjamdvj6.fsf@mina86.com> <878vce5cip.fsf@zancas.localnet>\r
+       <xa1tipbczo68.fsf@mina86.com>\r
+User-Agent: Notmuch/0.13.2+171~g2d1a988 (http://notmuchmail.org) Emacs/24.2.1\r
+       (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Mon, 17 Sep 2012 18:35:58 +0300\r
+Message-ID: <m21ui01x29.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\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: Mon, 17 Sep 2012 15:35:55 -0000\r
+\r
+On Mon, Sep 17 2012, Michal Nazarewicz wrote:\r
+\r
+>> Michal Nazarewicz <mina86@mina86.com> writes:\r
+>>> IMO this is totally unintuitive and not how the range should work.\r
+>>> date:foo..bar should return messages whose date >=3D foo and < bar.  So\r
+>>> for instance date:november..yesterday should return messages whose date\r
+>>> is > 2012/11/01 00:00:00 and < 2012/09/12 00:00:00.  So to get\r
+>>> yesterdays messages one would do: date:yesterday..today.\r
+>\r
+> On Thu, Sep 13 2012, David Bremner wrote:\r
+>> I don't find ranges being half-open by default to be very\r
+>> intuitive. Perhaps I don't program in python enough.\r
+>\r
+> Perhaps C than: =E2=80=9Cfor (i =3D 0; i < 10; ++i)=E2=80=9D is the stand=\r
+ard idiom and the\r
+> end range is open.\r
+>\r
+> Let's take a look at:\r
+>\r
+>      date:2012/01/01..2012/01/01 + 1 day\r
+>\r
+> in my opinion, that should give results from the first of January only,\r
+> since =E2=80=9C+ 1 day=E2=80=9D indicates in a way how long user want the=\r
+ period to be.\r
+>\r
+> I think it's also easier to pragmatically create ranges.  For instance,\r
+> let's say you want to create ranges for each week, you'd end up with:\r
+>\r
+>      date:2012/01/02..2012/01/09     ## 2012w01\r
+>      date:2012/01/09..2012/01/16     ## 2012w02\r
+>      date:2012/01/16..2012/01/23     ## 2012w03\r
+\r
+Ok, these matches with ISO Week...\r
+\r
+> Notice how the opening date of a range matches the closing date of\r
+> the previous date.\r
+\r
+       2012/01/02 is monday\r
+        2012/01/09 is monday.\r
+\r
+For me=20\r
+       date:2012/01/02..2012/01/08     ## 2012w01\r
+\r
+would be more intuitive in this context.\r
+\r
+\r
+for (i =3D 0; i < 10; ++i)  loops through 0 - 9.\r
+\r
+for (i =3D 1; i <=3D 10; ++i)  loops through 1 - 10.\r
+\r
+python -c 'for f in range(5): print f'  prints 0 - 4\r
+\r
+perl -le 'for (1..5) { print $_ }'  prints 1 - 5\r
+\r
+\r
+... these does not clarify, but confuses these intuitions :D\r
+\r
+>\r
+> --=20\r
+> Best regards,                                         _     _\r
+\r
+> ..o | Computer Science,  Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz =\r
+   (o o)\r
+\r
+Tomi\r