]> git.notmuchmail.org Git - notmuch/log
notmuch
8 years agodebian: another upload to work around gdb bugs debian/0.21-3
David Bremner [Sat, 14 Nov 2015 23:08:12 +0000 (19:08 -0400)]
debian: another upload to work around gdb bugs

8 years agodebian: release 0.21-2, architecture specific fixups debian/0.21-2
David Bremner [Thu, 12 Nov 2015 13:01:09 +0000 (09:01 -0400)]
debian: release 0.21-2, architecture specific fixups

8 years agorelease: disable wget certificate check 0.21 debian/0.21-1
David Bremner [Fri, 30 Oct 2015 10:12:50 +0000 (07:12 -0300)]
release: disable wget certificate check

this is a minor security hole, but no worse than what we had before. In
particular the worst that happens is someone prevents us from making a
release. Which is hardly worth the trouble of jacking the URL.

8 years agoNEWS: set date
David Bremner [Thu, 29 Oct 2015 23:08:11 +0000 (20:08 -0300)]
NEWS: set date

8 years agodebian: changelog stanza for 0.21
David Bremner [Thu, 29 Oct 2015 23:07:04 +0000 (20:07 -0300)]
debian: changelog stanza for 0.21

8 years agoversion: bump to 0.21
David Bremner [Thu, 29 Oct 2015 22:57:30 +0000 (19:57 -0300)]
version: bump to 0.21

8 years agoNEWS updates for some extra emacs functionality
Mark Walters [Thu, 29 Oct 2015 18:41:27 +0000 (18:41 +0000)]
NEWS updates for some extra emacs functionality

8 years agodebian: release 0.21~rc3-3 debian/0.21_rc3-3
David Bremner [Mon, 26 Oct 2015 01:09:56 +0000 (22:09 -0300)]
debian: release 0.21~rc3-3

Build-conflict with gdb-minimal, since there is no gdb-python to depend
on

8 years agodebian: bug fix upload for #802952 debian/0.21_rc3-2
David Bremner [Sun, 25 Oct 2015 16:44:06 +0000 (13:44 -0300)]
debian: bug fix upload for #802952

8 years agodebian: start changelog entry for 0.21
David Bremner [Fri, 23 Oct 2015 10:54:29 +0000 (07:54 -0300)]
debian: start changelog entry for 0.21

8 years agoNEWS: trim discussion of keybindings 0.21_rc3 debian/0.21_rc3-1
David Bremner [Thu, 22 Oct 2015 11:01:19 +0000 (08:01 -0300)]
NEWS: trim discussion of keybindings

Try to reduce the total size of NEWS

8 years agoversion: bump to 0.21~rc3
David Bremner [Thu, 22 Oct 2015 10:47:43 +0000 (07:47 -0300)]
version: bump to 0.21~rc3

8 years agoNEWS for minor emacs updates
Mark Walters [Wed, 21 Oct 2015 18:40:41 +0000 (19:40 +0100)]
NEWS for minor emacs updates

This adds NEWS items for

     the new limit/filter function in notmuch-show,

     the saved-search option for tree view,

     the binding S to run the current tree-view search in notmuch-search,

     the increase in max text part size

     the bugfix for replying to encrypted messages from tree view

8 years agoemacs: hello: bugfix: update docs for saved-searches
Mark Walters [Wed, 21 Oct 2015 18:51:37 +0000 (19:51 +0100)]
emacs: hello: bugfix: update docs for saved-searches

Update the documentation string for notmuch-saved-searches to include
the new :search-type option.

8 years agocompletion: complete lastmod: search prefix
Jani Nikula [Sat, 17 Oct 2015 21:03:35 +0000 (00:03 +0300)]
completion: complete lastmod: search prefix

8 years agocompletion: clean up top level completion
Jani Nikula [Sat, 17 Oct 2015 16:30:03 +0000 (19:30 +0300)]
completion: clean up top level completion

Add note about missing features.

8 years agocompletion: complete shared options for each command
Jani Nikula [Sat, 17 Oct 2015 16:30:02 +0000 (19:30 +0300)]
completion: complete shared options for each command

Add support for completing --help, --uuid=, and --version after the
subcommand. Do not support shared options at the top level yet due to
difficulties in handling options with arguments.

--uuid necessitates adding 'compopt -o nospace' also to notmuch new
completion, but that just brings it in line with the rest.

8 years agocompletion: complete notmuch count --lastmod
Jani Nikula [Sat, 17 Oct 2015 16:30:01 +0000 (19:30 +0300)]
completion: complete notmuch count --lastmod

8 years agocompletion: handle notmuch address --deduplicate= option
Jani Nikula [Sat, 26 Sep 2015 11:12:50 +0000 (14:12 +0300)]
completion: handle notmuch address --deduplicate= option

Complete notmuch address --deduplicate=(no|mailbox|address).

8 years agoemacs: tree: bind S to run current query in search mode
Mark Walters [Wed, 14 Oct 2015 08:38:23 +0000 (09:38 +0100)]
emacs: tree: bind S to run current query in search mode

8 years agoemacs: allow saved searches to select tree-view
Mark Walters [Wed, 14 Oct 2015 08:38:22 +0000 (09:38 +0100)]
emacs: allow saved searches to select tree-view

This patch allows the user to customize a saved search to choose tree
view rather than the default search view. It also updates notmuch-jump
so that it respects this choice.

8 years agoman: clarify the parameters for lastmod: range query
Jani Nikula [Sat, 17 Oct 2015 20:58:48 +0000 (23:58 +0300)]
man: clarify the parameters for lastmod: range query

<since> and <until> for the lastmod: prefix right below the date:
prefix description give the impression one could use last modified
dates to lastmod: which is not at all the case. Use
<initial-revision>..<final-revision> instead.

8 years agoNEWS: a few formatting updates for 0.21 news items (wiki compatibility)
Tomi Ollila [Mon, 19 Oct 2015 18:09:21 +0000 (21:09 +0300)]
NEWS: a few formatting updates for 0.21 news items (wiki compatibility)

Trailing dots were removed from 3 NEWS items so that those appear in
same level as surrounding "heading" lines in generated wiki page.

One trailing dot was added to nmbug-status item so it appears as normal
text in generated wiki page. `nmbug-status` was put in backticks so it
looks the same as in older nmbug-status news text.

8 years agodebian: changelog stanza for 0.21~rc2-1 0.21_rc2 debian/0.21_rc2-1
David Bremner [Mon, 19 Oct 2015 10:26:04 +0000 (07:26 -0300)]
debian: changelog stanza for 0.21~rc2-1

8 years agoversion: bump to 0.21~rc2
David Bremner [Mon, 19 Oct 2015 10:12:18 +0000 (07:12 -0300)]
version: bump to 0.21~rc2

8 years agoNEWS: news for notmuch_directory_delete
Jani Nikula [Sat, 17 Oct 2015 13:06:53 +0000 (16:06 +0300)]
NEWS: news for notmuch_directory_delete

8 years agoNEWS: news for notmuch address --deduplicate option
Jani Nikula [Sat, 17 Oct 2015 13:06:52 +0000 (16:06 +0300)]
NEWS: news for notmuch address --deduplicate option

8 years agoNEWS: news for date:<expr>..!
Jani Nikula [Sat, 17 Oct 2015 13:06:51 +0000 (16:06 +0300)]
NEWS: news for date:<expr>..!

8 years agoNEWS: nmbug-status supports sort order
Jani Nikula [Sat, 17 Oct 2015 13:06:50 +0000 (16:06 +0300)]
NEWS: nmbug-status supports sort order

8 years agoNEWS: note some Emacs UI changes for 0.21
David Bremner [Sat, 17 Oct 2015 13:06:01 +0000 (10:06 -0300)]
NEWS: note some Emacs UI changes for 0.21

8 years agoNEWS: new count api / deprecated count/search functions for 0.21
David Bremner [Sat, 17 Oct 2015 13:01:01 +0000 (10:01 -0300)]
NEWS: new count api / deprecated count/search functions for 0.21

8 years agoNEWS: note some build system changes for 0.21
David Bremner [Sat, 17 Oct 2015 12:57:40 +0000 (09:57 -0300)]
NEWS: note some build system changes for 0.21

The ruby bindings changes in particular will be user visible. The
skipped tests status may also be interesting for packagers

8 years agoNEWS: news for initial revision tracking support (0.21)
David Bremner [Sat, 17 Oct 2015 12:39:19 +0000 (09:39 -0300)]
NEWS: news for initial revision tracking support (0.21)

8 years agoemacs: show: increase default max-text-part-size
Mark Walters [Thu, 15 Oct 2015 18:53:09 +0000 (19:53 +0100)]
emacs: show: increase default max-text-part-size

Currently notmuch-show-max-text-part-size is 10000 which means some
relatively normal messages have all parts hidden by default. Increase
this to 100000 by default.

The setting was introduced to alleviate problems with notmuch being
very slow on large threads. Users hitting these problems may wish to
customize this variable to something smaller (like 10000).

8 years agoemacs: tree bugfix
Mark Walters [Thu, 15 Oct 2015 18:46:34 +0000 (19:46 +0100)]
emacs: tree bugfix

Formerly replying to an encrypted message in tree-view did not work:
the message was not decrypted. This commit makes notmuch-tree respect
the setting of notmuch-crypto-process-mime. In particular, if
notmuch-crypto-process-mime is set to t, then replying to encrypted
messages in tree mode will now decrypt the reply (as it already did in
show mode).

8 years agodoc: update copyright year to contain range 2009-2015
Tomi Ollila [Thu, 15 Oct 2015 17:57:43 +0000 (20:57 +0300)]
doc: update copyright year to contain range 2009-2015

Now it is accurate and provides more information to the
reader of the documents.

8 years agodebian: update symbols file 0.21_rc1
David Bremner [Thu, 15 Oct 2015 13:09:24 +0000 (10:09 -0300)]
debian: update symbols file

we are only adding symbols, which is exactly the interesting case for a
symbols file.

8 years agoversion: bump to 0.21~rc1
David Bremner [Thu, 15 Oct 2015 11:16:26 +0000 (08:16 -0300)]
version: bump to 0.21~rc1

8 years agodebian: update changelogs for pre-release
David Bremner [Thu, 15 Oct 2015 11:14:19 +0000 (08:14 -0300)]
debian: update changelogs for pre-release

a sensible changelog can wait for upstream NEWS to be updated

8 years agocli: delete directory documents on directory removal 0.21_rc0
Jani Nikula [Fri, 25 Sep 2015 20:48:46 +0000 (23:48 +0300)]
cli: delete directory documents on directory removal

There was a problem with the directory documents being left behind when
the filesystem directory was removed. This was worked around in [1].
However, that ignored the fact that the directory documents are also
still listed by notmuch_directory_get_child_directories() leading to
confusing results when running notmuch new. The directory documents are
found and queued for removal over and over again.

Fix the problem for real by removing the directory documents. This fixes
the tests flagged as broken in [2].

The (non-deterministic) hack test from [3] also still passes with this
change.

[1] commit acd66cdec075312944e527febd46382e54d99367
[2] commit ed9ceda623d3f22fb66365b33db63c5c982067d3
[3] id:1441445731-4362-1-git-send-email-jani@nikula.org

8 years agolib: add interface to delete directory documents
Jani Nikula [Fri, 25 Sep 2015 20:48:45 +0000 (23:48 +0300)]
lib: add interface to delete directory documents

As mentioned in acd66cdec075312944e527febd46382e54d99367 we don't have
an interface to delete directory documents, and they're left behind. Add
the interface.

8 years agotest: flag one more notmuch new test as broken
Jani Nikula [Fri, 25 Sep 2015 20:48:44 +0000 (23:48 +0300)]
test: flag one more notmuch new test as broken

Drop the test update added in [1] and mark the test as broken, like the
tests flagged as broken in [2]. These all reflect the same underlying
breakage with (lack of) directory deletion.

[1] commit e4e04bbc328f990e36b77f508aef904d156029b1
[2] commit ed9ceda623d3f22fb66365b33db63c5c982067d3

8 years agolib: update doxygen comments to add @since for the new _st API
David Bremner [Mon, 5 Oct 2015 23:16:59 +0000 (20:16 -0300)]
lib: update doxygen comments to add @since for the new _st API

We should probably to this for all new functions introduced from now on.

8 years agoruby: use new query_search API
David Bremner [Sun, 27 Sep 2015 15:32:03 +0000 (12:32 -0300)]
ruby: use new query_search API

These changes should not be too surprising for users because the
routines were already potentially throwing exceptions.

8 years agolib: migrate thread.cc to new query_search API
David Bremner [Sun, 27 Sep 2015 15:32:02 +0000 (12:32 -0300)]
lib: migrate thread.cc to new query_search API

here we rely on thread_id_query being attached to the local talloc
context, so no new cleanup code is needed.

8 years agolib: migrate notmuch_database_upgrade to new query_search API
David Bremner [Sun, 27 Sep 2015 15:32:01 +0000 (12:32 -0300)]
lib: migrate notmuch_database_upgrade to new query_search API

Here we depend on the error path cleaning up query

8 years agopython: update bindings for new count API
David Bremner [Sun, 27 Sep 2015 15:32:00 +0000 (12:32 -0300)]
python: update bindings for new count API

Note that any mismatches are not detected until runtime (if at all)
with the python bindings, so tests are crucial

8 years agoruby: use new count API
David Bremner [Sun, 27 Sep 2015 15:31:59 +0000 (12:31 -0300)]
ruby: use new count API

This change of replacing ignoring errors with exceptions is intended,
and indeed one of the main motivations for the libnotmuch API changes.

8 years agocli: update to use new count API
David Bremner [Sun, 27 Sep 2015 15:31:58 +0000 (12:31 -0300)]
cli: update to use new count API

Essentially replace each call to notmuch_count_* with the corresponding
_st call, followed by print_status_query.

8 years agolib: add versions of n_q_count_{message,threads} with status return
David Bremner [Sun, 27 Sep 2015 15:31:57 +0000 (12:31 -0300)]
lib: add versions of n_q_count_{message,threads} with status return

Although I think it's a pretty bad idea to continue using the old API,
this allows both a more gentle transition for clients of the library,
and allows us to break one monolithic change into a series

8 years agocli/count: simplify and document return value of print_count
David Bremner [Sun, 27 Sep 2015 15:31:56 +0000 (12:31 -0300)]
cli/count: simplify and document return value of print_count

Essentially a cosmetic change.

8 years agolib: move query variable to function scope
David Bremner [Sun, 27 Sep 2015 15:31:55 +0000 (12:31 -0300)]
lib: move query variable to function scope

This is a prelude to deallocating it (if necessary) on the error path.

8 years agonmbug-status: print config errors to stderr
Jani Nikula [Sat, 3 Oct 2015 07:57:56 +0000 (10:57 +0300)]
nmbug-status: print config errors to stderr

Particularly scripted usage with stdout redirection can be confusing
if errors are printed to stdout instead of stderr.

8 years agonotmuch-emacs-mua: make --auto-daemon imply --create-frame
Tomi Ollila [Wed, 30 Sep 2015 06:36:52 +0000 (09:36 +0300)]
notmuch-emacs-mua: make --auto-daemon imply --create-frame

Before this change with --auto-daemon but without --create-frame
emacs server was started but no clients stay connected to it
(in both graphical and terminal displays).

Note that this changes how --client --auto-daemon works on
graphical display; New emacs frame is now created for the
message (and message-exit-actions hook appended).

8 years agonotmuch-emacs-mua: do not create a frame by default with --client
Jani Nikula [Sat, 15 Aug 2015 09:05:15 +0000 (12:05 +0300)]
notmuch-emacs-mua: do not create a frame by default with --client

Make the default behaviour for --client the same as emacsclient
default: do not create a new frame. Add a new option --create-frame,
passing the same option to emacsclient to create a frame.

8 years agonotmuch-emacs-mua: add --auto-daemon option to start Emacs daemon as needed
Jani Nikula [Sat, 15 Aug 2015 09:05:14 +0000 (12:05 +0300)]
notmuch-emacs-mua: add --auto-daemon option to start Emacs daemon as needed

Automatically starting Emacs in daemon mode if the Emacs server is not
running is a matter of preference better not hard coded in
notmuch-emacs-mua. Add an option to control the behaviour.

8 years agonotmuch-emacs-mua: move --client option handling around
Jani Nikula [Sat, 15 Aug 2015 09:05:13 +0000 (12:05 +0300)]
notmuch-emacs-mua: move --client option handling around

Move --client handling to a more suitable location. No functional
changes.

8 years agonotmuch-emacs-mua: support --no-window-system also for non-client
Jani Nikula [Sat, 15 Aug 2015 09:05:12 +0000 (12:05 +0300)]
notmuch-emacs-mua: support --no-window-system also for non-client

Clearly --no-window-system should be applicable without --client as
well. Prepare for future changes with the naming of the variables.

8 years agoman: clean up notmuch-emacs-mua man page
Jani Nikula [Sat, 15 Aug 2015 09:05:11 +0000 (12:05 +0300)]
man: clean up notmuch-emacs-mua man page

Move --client description to a more suitable location, stylistic
changes.

8 years agocli: use designated initializer to initialize add_files_state
Jani Nikula [Fri, 25 Sep 2015 18:47:35 +0000 (21:47 +0300)]
cli: use designated initializer to initialize add_files_state

The side effect is that all of add_files_state will be initialized to
zero, removing any lingering doubt that some of it might not be
initialized. It's not a small struct, and the initialization is
scattered around a bit, so this makes the code more readable.

8 years agonmbug-status: add support for specifying sort order for each view
Jani Nikula [Sat, 26 Sep 2015 11:37:51 +0000 (14:37 +0300)]
nmbug-status: add support for specifying sort order for each view

Let each view have a "sort" key, typically used with values
"oldest-first" or "newest-first" (although all values in Query.SORT
are accepted), and sort the results accordingly. Oldest first remains
the default.

The dynamic approach of mapping sort values is as suggested by
W. Trevor King <wking@tremily.us>.

8 years agoMerge branch 'release'
David Bremner [Sat, 26 Sep 2015 13:31:50 +0000 (10:31 -0300)]
Merge branch 'release'

bring debian specific changes into master

8 years agodebian: changelog stanza for 0.20.2-2 debian/0.20.2-2
David Bremner [Sat, 26 Sep 2015 12:27:34 +0000 (09:27 -0300)]
debian: changelog stanza for 0.20.2-2

8 years agodebian: fix linking in emacsen-install script
David Bremner [Sat, 26 Sep 2015 12:22:11 +0000 (09:22 -0300)]
debian: fix linking in emacsen-install script

When upgrading emacs, the install file can (apparently) be called with
the lisp files already linked into the flavour specific
directories. In this case we should not fail.

8 years agocli: do not sort addresses on --output=count or --deduplicate=address
Jani Nikula [Thu, 3 Sep 2015 19:40:05 +0000 (22:40 +0300)]
cli: do not sort addresses on --output=count or --deduplicate=address

The order of the results with --output=count and --deduplicate=address
are unspecified as they're based on a hash table traversal. This being
the case, optimize the query by explicitly requesting unsorted
results. Clarify the documentation accordingly.

8 years agoman: document notmuch address --deduplicate=address option
Jani Nikula [Thu, 3 Sep 2015 19:40:04 +0000 (22:40 +0300)]
man: document notmuch address --deduplicate=address option

Document the deduplication based on case insensitive address.

8 years agotest: add notmuch address --deduplicate=(no|mailbox|address) tests
Jani Nikula [Fri, 25 Sep 2015 17:08:09 +0000 (20:08 +0300)]
test: add notmuch address --deduplicate=(no|mailbox|address) tests

First a simple smoke test first, next generate messages with multiple
email address variants and check the behaviour of deduplication
schemes with these.

8 years agocli: add support for deduplicating based on case insensitive address
Jani Nikula [Thu, 3 Sep 2015 19:40:03 +0000 (22:40 +0300)]
cli: add support for deduplicating based on case insensitive address

Consider all variants of an email address as one, and print the most
common variant.

8 years agocli: change the data structure for notmuch address deduplication
Jani Nikula [Fri, 25 Sep 2015 16:48:20 +0000 (19:48 +0300)]
cli: change the data structure for notmuch address deduplication

Currently we key the address hash table with the case sensitive "name
<address>". Switch to case insensitive keying with just address, and
store the case sensitive name and address in linked lists. This will
be helpful in adding support for different deduplication schemes in
the future.

There will be a slight performance penalty for the current full case
sensitive name + address deduplication, but this is simpler as a whole
when other deduplication schemes are added, and I expect the schemes
to be added to become more popular than the current default.

Aparet from the possible performance penalty, the only user visible
change should be the change in the output ordering for
--output=count. The order is not guaranteed (and is based on hash
table traversal) currently anyway, so this should be of no
consequence.

8 years agoutil: add strcmp_null, a strcmp that handles NULL parameters
Jani Nikula [Fri, 25 Sep 2015 16:48:19 +0000 (19:48 +0300)]
util: add strcmp_null, a strcmp that handles NULL parameters

Add strcmp_null, a strcmp that handles NULL strings; in strcmp terms a
NULL string is considered to be less than a non-NULL string.

8 years agolib: add support for date:<expr>..! to mean date:<expr>..<expr>
Jani Nikula [Sat, 15 Aug 2015 11:25:47 +0000 (14:25 +0300)]
lib: add support for date:<expr>..! to mean date:<expr>..<expr>

It doesn't seem likely we can support simple date:<expr> expanding to
date:<expr>..<expr> any time soon. (This can be done with a future
version of Xapian, or with a custom query query parser.) In the mean
time, provide shorthand date:<expr>..! to mean the same. This is
useful, as the expansion takes place before interpetation, and we can
use, for example, date:yesterday..! to match from beginning of
yesterday to end of yesterday.

Idea from Mark Walters <markwalters1009@gmail.com>.

8 years agotest suite: don't consider skipped individual tests as failing
David Bremner [Thu, 24 Sep 2015 11:13:30 +0000 (08:13 -0300)]
test suite: don't consider skipped individual tests as failing

It isn't completely clear what we want to do here, but

1) We currently don't fail if we skip a whole test file (mainly because
we neglect to count those skipped tests properly). This change at least
makes the two kinds of skipping consistent.

2) Automated build environments may have good reasons for building with
a minimal set of prereqs, and we don't want to discourage running our
test suite by breaking builds.

8 years agomake test: NOTMUCH_TEST_QUIET=1 is now the default
Tomi Ollila [Fri, 11 Sep 2015 20:44:11 +0000 (23:44 +0300)]
make test: NOTMUCH_TEST_QUIET=1 is now the default

make test V=1 (or any other value than 0) and make test V=0
works similar way as build in general

8 years agoman: document notmuch address --deduplicate=(no|mailbox) option
Jani Nikula [Wed, 23 Sep 2015 19:31:13 +0000 (22:31 +0300)]
man: document notmuch address --deduplicate=(no|mailbox) option

Document the deduplication of results.

8 years agotest: notmuch address --deduplicate=no tests
Jani Nikula [Fri, 4 Sep 2015 18:35:16 +0000 (21:35 +0300)]
test: notmuch address --deduplicate=no tests

Test not using address deduplication. Incorporate some trivial output
sorting tests here, as they seem to lack tests.

8 years agocli: add support for not deduplicating notmuch address results
Jani Nikula [Thu, 3 Sep 2015 19:39:59 +0000 (22:39 +0300)]
cli: add support for not deduplicating notmuch address results

Make it possible to use notmuch address as part of a | sort | uniq -c
pipe instead of forcing --output=count. This is useful for combining
results from multiple notmuch address queries.

8 years agotest: check argc in symbol-test
Jani Nikula [Wed, 23 Sep 2015 18:48:05 +0000 (21:48 +0300)]
test: check argc in symbol-test

Check argc mainly to fix unused parameter warning:

test/symbol-test.cc:7:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
  int main(int argc, char** argv) {
               ^

This makes more sense than telling the compiler it's unused on
purpose.

8 years agolib: constify arguments to notmuch_query_get_*
David Bremner [Wed, 23 Sep 2015 11:31:19 +0000 (08:31 -0300)]
lib: constify arguments to notmuch_query_get_*

These functions are all just accessors, and it's pretty clear they don't
modify the query struct. This also fixes one warning I created when I
introduced status.c.

8 years agocli: convert remainder of CLI to n_q_search_{messages,threads}_st
David Bremner [Sun, 6 Sep 2015 13:15:47 +0000 (10:15 -0300)]
cli: convert remainder of CLI to n_q_search_{messages,threads}_st

I think it would be no real problem to cut and paste the gdb based
error message test from count to the other clients modified here, but
I'm not currently convinced it's worth the trouble since the code path
being tested is almost the the same, and the tests are relatively
heavyweight.

8 years agocli/count: update to use notmuch_query_search_messages_st
David Bremner [Sun, 6 Sep 2015 13:15:46 +0000 (10:15 -0300)]
cli/count: update to use notmuch_query_search_messages_st

This brings back status information that may have been hidden by the
great library logging conversion.

Note the change of the internal API / return-value for count_files. The
other count calls to the lib will also get error handling when that API
is updated in the lib.

8 years agocli: add utility routine to print error status.
David Bremner [Sun, 6 Sep 2015 13:15:45 +0000 (10:15 -0300)]
cli: add utility routine to print error status.

No attention to formatting here, initially just focus on getting the
relevant strings out of the library.

8 years agocli/count: apply uncrustify changes
David Bremner [Mon, 7 Sep 2015 13:29:14 +0000 (10:29 -0300)]
cli/count: apply uncrustify changes

Leave the indentation alone because I don't know how to duplicate it
with Emacs.

8 years agocli/count: remove unused argument handling for output=modifications
David Bremner [Mon, 7 Sep 2015 13:08:25 +0000 (10:08 -0300)]
cli/count: remove unused argument handling for output=modifications

In the end this UI was rejected, but bits of it stayed in the code to
confuse future generations.

8 years agoutil: move strcase_equal and strcase_hash to util
Jani Nikula [Thu, 3 Sep 2015 19:40:01 +0000 (22:40 +0300)]
util: move strcase_equal and strcase_hash to util

For future use in both cli and lib.

8 years agocli: abstract new mailbox creation
Jani Nikula [Thu, 3 Sep 2015 19:39:58 +0000 (22:39 +0300)]
cli: abstract new mailbox creation

We'll be needing more mailbox creation soon, so abstract it
away. While at it, check for allocation failures. No other functional
changes.

8 years agocli: g_hash_table_lookup_extended is overkill
Jani Nikula [Thu, 3 Sep 2015 19:39:57 +0000 (22:39 +0300)]
cli: g_hash_table_lookup_extended is overkill

Switch to normal glib hash table lookup. The extended version is only
required if the values may contain NULL.

8 years agotest: fix whitespace/indentation in symbol-test
Jani Nikula [Fri, 4 Sep 2015 18:49:14 +0000 (21:49 +0300)]
test: fix whitespace/indentation in symbol-test

Not of much consequence, but makes it nicer to do further edits.

8 years agocli: reset db directory mtime upon directory removal
Jani Nikula [Sat, 5 Sep 2015 09:35:31 +0000 (12:35 +0300)]
cli: reset db directory mtime upon directory removal

The library does not have a function to remove a directory document
for a path. Usually this doesn't matter except for a slight waste of
space. However, if the same directory gets added to the filesystem
again, the old directory document is found with the old mtime. Reset
the directory mtime on removal to avoid problems.

The corner case that can hit this problem is renaming directories back
and forth. Renaming does not change the mtime of the directory in the
filesystem, and thus the old db directory document mtime may match the
fs mtime of the directory.

The long term fix might be to add a library function to remove a
directory document, however this is a much simpler and faster fix for
the time being.

8 years agoemacs: wrap current search in parens when filtering
Uli Scholler [Sun, 6 Sep 2015 21:29:05 +0000 (23:29 +0200)]
emacs: wrap current search in parens when filtering

When filtering the current search further with notmuch-search-filter,
wrap the current search in parens (if necessary).

This fixes unexpected behavior when the current search is
complex (like "(tag:this and date:one_week_ago..) or tag:that").

8 years agolib: constify argument to notmuch_database_status_string
David Bremner [Sun, 7 Jun 2015 15:02:00 +0000 (17:02 +0200)]
lib: constify argument to notmuch_database_status_string

We don't modify the database struct, so no harm in committing to that.

8 years agotest: move backup_database and restore_database to library
David Bremner [Sun, 7 Jun 2015 15:01:59 +0000 (17:01 +0200)]
test: move backup_database and restore_database to library

The plan is to re-use them in testing the same errors from the CLI

8 years agolib: note remaining uses of deprecated message search API
David Bremner [Sun, 7 Jun 2015 15:01:58 +0000 (17:01 +0200)]
lib: note remaining uses of deprecated message search API

The two remaining cases in the lib seem to require more than a simple
replacement of the old call, with the new call plus a check of the
return value.

8 years agolib: remove use of notmuch_query_search_messages from query.cc
David Bremner [Sun, 7 Jun 2015 15:01:57 +0000 (17:01 +0200)]
lib: remove use of notmuch_query_search_messages from query.cc

There is not too much point in worrying about the bad error reporting
here, because the count api is due for the same deprecation.

8 years agocli/lib: remove support for GMime 2.4
David Bremner [Sun, 16 Aug 2015 15:33:21 +0000 (17:33 +0200)]
cli/lib: remove support for GMime 2.4

It's becoming a maintenance burden to do anything things with the
crypto glue code twice, once for 2.4 and once for 2.6. I don't have
any 2.4 version available to test on my development machine anymore,
so the 2.4 specific code paths are likely not very well tested.

8 years agolib: Add "lastmod:" queries for filtering by last modification
Austin Clements [Mon, 13 Oct 2014 06:20:03 +0000 (02:20 -0400)]
lib: Add "lastmod:" queries for filtering by last modification

The implementation is essentially the same as the date range search
prior to Jani's fancy date parser.

8 years agocli: add global option "--uuid"
David Bremner [Sun, 5 Apr 2015 22:39:55 +0000 (07:39 +0900)]
cli: add global option "--uuid"

The function notmuch_exit_if_unmatched_db_uuid is split from
notmuch_process_shared_options because it needs an open notmuch
database.

There are two exceptional cases in uuid handling.

1) notmuch config and notmuch setup don't currently open the database,
   so it doesn't make sense to check the UUID.

2) notmuch compact opens the database inside the library, so we either
   need to open the database just to check uuid, or change the API.

8 years agocli/count: add --lastmod
David Bremner [Fri, 5 Jun 2015 06:16:17 +0000 (08:16 +0200)]
cli/count: add --lastmod

In the short term we need a way to get lastmod information e.g. for
the test suite. In the long term we probably want to add lastmod
information to at least the structured output for several other
clients (e.g. show, search).

8 years agolib: API to retrieve database revision and UUID
Austin Clements [Mon, 13 Oct 2014 06:20:02 +0000 (02:20 -0400)]
lib: API to retrieve database revision and UUID

This exposes the committed database revision to library users along
with a UUID that can be used to detect when revision numbers are no
longer comparable (e.g., because the database has been replaced).

8 years agolib: Add per-message last modification tracking
Austin Clements [Mon, 13 Oct 2014 06:20:01 +0000 (02:20 -0400)]
lib: Add per-message last modification tracking

This adds a new document value that stores the revision of the last
modification to message metadata, where the revision number increases
monotonically with each database commit.

An alternative would be to store the wall-clock time of the last
modification of each message.  In principle this is simpler and has
the advantage that any process can determine the current timestamp
without support from libnotmuch.  However, even assuming a computer's
clock never goes backward and ignoring clock skew in networked
environments, this has a fatal flaw.  Xapian uses (optimistic)
snapshot isolation, which means reads can be concurrent with writes.
Given this, consider the following time line with a write and two read
transactions:

   write  |-X-A--------------|
   read 1       |---B---|
   read 2                      |---|

The write transaction modifies message X and records the wall-clock
time of the modification at A.  The writer hangs around for a while
and later commits its change.  Read 1 is concurrent with the write, so
it doesn't see the change to X.  It does some query and records the
wall-clock time of its results at B.  Transaction read 2 later starts
after the write commits and queries for changes since wall-clock time
B (say the reads are performing an incremental backup).  Even though
read 1 could not see the change to X, read 2 is told (correctly) that
X has not changed since B, the time of the last read.  In fact, X
changed before wall-clock time A, but the change was not visible until
*after* wall-clock time B, so read 2 misses the change to X.

This is tricky to solve in full-blown snapshot isolation, but because
Xapian serializes writes, we can use a simple, monotonically
increasing database revision number.  Furthermore, maintaining this
revision number requires no more IO than a wall-clock time solution
because Xapian already maintains statistics on the upper (and lower)
bound of each value stream.

8 years agoconfigure: clean up messages around reading libnotmuch version
Jani Nikula [Mon, 10 Aug 2015 12:39:16 +0000 (15:39 +0300)]
configure: clean up messages around reading libnotmuch version

Clean up punctuation for consistency, and add newline for clean
configure output.