[RFC PATCH 0/3] add user friendly date range search

Jani Nikula jani at nikula.org
Wed Aug 10 03:22:04 PDT 2011


Hi, this RFC series adds user friendly date range searches in notmuch.

Patches 1 and 2 add the date/time parser from coreutils, and were posted to
the list by Michal Sojka in January [1]. I picked them up from the
date-parser branch of the git tree at [2]. These worked without
modifications, so I didn't touch them.

Patch 3 adds the actual date range searches on top of current
master. Michal also posted a date search implementation, but it was based
on Austin Clements' custom parser patches, which I haven't looked at. Also,
this one uses date: range syntax rather than before: and after:, and I
think Michal would agree on this one [3].

If the same parser is to be eventually included in notmuch, I'd prefer
using the parse-datetime module [3] (get_date() was renamed) directly from
gnulib [4], instead of coreutils or elsewhere that just imports from
gnulib. Also, I think the gnulib module should be placed in a subdirectory
rather than alongside all the notmuch lib files. However there are some
complications in using parse-datetime, as gnulib modules heavily rely on
autotools. Perhaps one option would be to build a separate library with
autotools that has what we need from gnulib?

Anyway, this is here now, and works (well, with caveats outlined in the
commit message for patch 3) so that people can try this and get a feel of
the date range search. I wouldn't put much efforts to cleanly importing
gnulib before there's some guarantee that the syntax and semantics are
desired in the first place.

Personally, I've been happy with it ever since I got used to the semantics
of the parser.


BR,
Jani.


[1] http://notmuchmail.org/pipermail/notmuch/2011/003749.html
[2] git://rtime.felk.cvut.cz/notmuch.git
[3] http://notmuchmail.org/pipermail/notmuch/2011/004096.html
[4] http://www.gnu.org/s/gnulib/MODULES.html#module=parse-datetime
[3] http://www.gnu.org/s/gnulib/


Jani Nikula (1):
  lib: add gnulib get_date() based date range search

Michal Sojka (2):
  Import date/time parser from GNU coreutils
  Compile the date/time parser into notmuch library

 Makefile.local         |    3 +
 configure              |    8 +
 lib/Makefile.local     |    6 +-
 lib/c-ctype.c          |  398 ++++++
 lib/c-ctype.h          |  297 ++++
 lib/config.h           |   45 +
 lib/database-private.h |    1 +
 lib/database.cc        |    4 +
 lib/getdate-proc.cc    |   32 +
 lib/getdate-proc.h     |   21 +
 lib/getdate.c          | 3506 ++++++++++++++++++++++++++++++++++++++++++++++++
 lib/getdate.h          |   31 +
 lib/getdate.y          | 1581 ++++++++++++++++++++++
 lib/gettime.c          |   48 +
 lib/intprops.h         |   83 ++
 lib/timespec.h         |   39 +
 lib/verify.h           |  140 ++
 17 files changed, 6242 insertions(+), 1 deletions(-)
 create mode 100644 lib/c-ctype.c
 create mode 100644 lib/c-ctype.h
 create mode 100644 lib/config.h
 create mode 100644 lib/getdate-proc.cc
 create mode 100644 lib/getdate-proc.h
 create mode 100644 lib/getdate.c
 create mode 100644 lib/getdate.h
 create mode 100644 lib/getdate.y
 create mode 100644 lib/gettime.c
 create mode 100644 lib/gettime.h
 create mode 100644 lib/intprops.h
 create mode 100644 lib/timespec.h
 create mode 100644 lib/verify.h



More information about the notmuch mailing list