notmuch
4 years agofixup! NEWS: news for 0.24.2 0.24.2 debian/0.24.2-1
David Bremner [Thu, 1 Jun 2017 10:32:10 +0000 (07:32 -0300)]
fixup! NEWS: news for 0.24.2

4 years agodebian: changelog for 0.24.2-1
David Bremner [Thu, 1 Jun 2017 10:25:56 +0000 (07:25 -0300)]
debian: changelog for 0.24.2-1

4 years agoNEWS: news for 0.24.2
David Bremner [Thu, 1 Jun 2017 10:19:46 +0000 (07:19 -0300)]
NEWS: news for 0.24.2

4 years agoversion: bump to 0.24.2
David Bremner [Thu, 1 Jun 2017 10:13:00 +0000 (07:13 -0300)]
version: bump to 0.24.2

4 years agocli/dump: don't include tags when not asked for
David Bremner [Mon, 8 May 2017 01:44:23 +0000 (22:44 -0300)]
cli/dump: don't include tags when not asked for

Add in the analogous test for tags that is given for properties a few
lines below.

4 years agotest: add known broken test --include=properties
David Bremner [Mon, 8 May 2017 01:44:22 +0000 (22:44 -0300)]
test: add known broken test --include=properties

Reported in [1], --include=properties currently implies
--include=tags, but it should not.

[1] id:87y3u8vjbo.fsf@tethera.net

4 years agoemacs: tree: bugfix: specify --format-version
Mark Walters [Sat, 15 Apr 2017 15:49:46 +0000 (16:49 +0100)]
emacs: tree: bugfix: specify --format-version

Previously notmuch tree did not specify the format-version when
calling notmuch. This meant that when the structured output was
slightly changed (in commit 14c60cf168ac3b0f277188c16e6012b7ebdadde7)
stash filename broke. This fixes this breakage by specifying the
format-version.

4 years agoNEWS: set release date 0.24.1 debian/0.24.1-1
David Bremner [Sat, 1 Apr 2017 12:29:38 +0000 (09:29 -0300)]
NEWS: set release date

4 years agoMerge branch 'debian' into release
David Bremner [Sat, 1 Apr 2017 12:20:44 +0000 (09:20 -0300)]
Merge branch 'debian' into release

Merge in changelog stanza from debian upload targeted at stretch

4 years agodebian: finalize changelog for 0.24.1-1
David Bremner [Sat, 1 Apr 2017 12:18:56 +0000 (09:18 -0300)]
debian: finalize changelog for 0.24.1-1

4 years agoNEWS: note dump header fix
David Bremner [Sat, 1 Apr 2017 12:15:30 +0000 (09:15 -0300)]
NEWS: note dump header fix

4 years agocli/dump: bump dump format version to 3
David Bremner [Fri, 31 Mar 2017 10:55:17 +0000 (07:55 -0300)]
cli/dump: bump dump format version to 3

No changes to the format of the body, but the header format was
fixed, and version 2 headers probably shouldn't be relied on.

4 years agocli/dump: fix bug in dump header
David Bremner [Tue, 28 Mar 2017 11:09:03 +0000 (08:09 -0300)]
cli/dump: fix bug in dump header

Fix copy paste error.

4 years agotest: add known broken test for dump header
David Bremner [Tue, 28 Mar 2017 11:09:02 +0000 (08:09 -0300)]
test: add known broken test for dump header

Apparently nobody uses the list of "what was included in the dump"

4 years agoNEWS: initial NEWS changes for 0.24.1
David Bremner [Sat, 25 Mar 2017 14:35:28 +0000 (11:35 -0300)]
NEWS: initial NEWS changes for 0.24.1

Also add a missed note to the 0.24 release notes.

4 years agolib: handle empty string in regexp field processors
David Bremner [Fri, 24 Mar 2017 22:52:51 +0000 (19:52 -0300)]
lib: handle empty string in regexp field processors

The non-field processor behaviour is is convert the corresponding
queries into a search for the unprefixed terms. This yields pretty
surprising results so I decided to generate a query that would match
the terms (i.e. none with that prefix) generated for an empty header.

4 years agotest: add known broken test for null from: and subject: query
David Bremner [Fri, 24 Mar 2017 22:52:50 +0000 (19:52 -0300)]
test: add known broken test for null from: and subject: query

These queries currently fail with field processors enabled because the
code expects a non-empty string.

4 years agodebian: start changelog for 0.24.1-1
David Bremner [Sat, 25 Mar 2017 14:22:55 +0000 (11:22 -0300)]
debian: start changelog for 0.24.1-1

4 years agoversion: bump to 0.24.1
David Bremner [Sat, 25 Mar 2017 14:20:56 +0000 (11:20 -0300)]
version: bump to 0.24.1

The release is not yet finalized, but start the busywork needed.

4 years agolib: only trigger phrase processing for regexp fields when needed
David Bremner [Sat, 18 Mar 2017 02:23:51 +0000 (23:23 -0300)]
lib: only trigger phrase processing for regexp fields when needed

The argument is that if the string passed to the field processor has
no spaces, then the added quotes won't have any benefit except for
disabling wildcards. But disabling wildcards doesn't seem very useful
in the normal Xapian query parser, since they're stripped before
generating terms anyway. It does mean that the query 'from:"foo*"' will
not be precisely equivalent to 'from:foo' as it is for the non
field-processor version.

4 years agotest: add known broken tests wildcard search in from and subject
David Bremner [Fri, 17 Mar 2017 12:17:48 +0000 (09:17 -0300)]
test: add known broken tests wildcard search in from and  subject

This was broken by the addition of regexp searching. The detection of
wildcards is not currently done in the recursive call to parse_query,
because of quoting issues.

4 years agodebian: changelog stanza for 0.23.7-2 debian/0.23.7-2
David Bremner [Sun, 19 Mar 2017 12:39:06 +0000 (09:39 -0300)]
debian: changelog stanza for 0.23.7-2

4 years agolib/message.cc: fix Coverity finding (use after free)
Tomi Ollila [Fri, 17 Mar 2017 22:28:48 +0000 (00:28 +0200)]
lib/message.cc: fix Coverity finding (use after free)

The object where pointer to `data` was received was deleted before
it was used in _notmuch_string_list_append().

Relevant Coverity messages follow:

3: extract
Assigning: data = std::__cxx11::string(message->doc.()).c_str(),
which extracts wrapped state from temporary of type std::__cxx11::string.

4: dtor_free
The internal representation of temporary of type std::__cxx11::string
is freed by its destructor.

5: use after free:
Wrapper object use after free (WRAPPER_ESCAPE)
Using internal representation of destroyed object local data.

(cherry picked from commit 06adc276682d1d5f73d78df2e898ad4191eb4499)

4 years agolib/message.cc: fix Coverity finding (use after free)
Tomi Ollila [Fri, 17 Mar 2017 22:28:48 +0000 (00:28 +0200)]
lib/message.cc: fix Coverity finding (use after free)

The object where pointer to `data` was received was deleted before
it was used in _notmuch_string_list_append().

Relevant Coverity messages follow:

3: extract
Assigning: data = std::__cxx11::string(message->doc.()).c_str(),
which extracts wrapped state from temporary of type std::__cxx11::string.

4: dtor_free
The internal representation of temporary of type std::__cxx11::string
is freed by its destructor.

5: use after free:
Wrapper object use after free (WRAPPER_ESCAPE)
Using internal representation of destroyed object local data.

4 years agocli/show: unref crlf filter.
David Bremner [Sat, 18 Mar 2017 17:46:42 +0000 (14:46 -0300)]
cli/show: unref crlf filter.

Mimic the handling of the other filter g_objects. This cleans up a
fair sized memory leak.

4 years agocli/show: fix usage of g_mime_content_type_to_string
David Bremner [Sat, 18 Mar 2017 17:33:50 +0000 (14:33 -0300)]
cli/show: fix usage of g_mime_content_type_to_string

It returns an "allocated string", which needs to be freed.

4 years agocli/show: fix some memory leaks in format_part_text
David Bremner [Sat, 18 Mar 2017 17:07:45 +0000 (14:07 -0300)]
cli/show: fix some memory leaks in format_part_text

Mimic Jeff Stedfast's changes to format_headers_sprinter, clean up use
of internet_address_list_to_string and
g_mime_message_get_date_as_string.

4 years agofix memory leaks in notmuch-show.c:format_headers_sprinter()
Jeffrey Stedfast [Thu, 16 Mar 2017 16:53:47 +0000 (16:53 +0000)]
fix memory leaks in notmuch-show.c:format_headers_sprinter()

Internet_address_list_to_string() and
g_mime_message_get_date_as_string() return allocated string buffers
and not const, so from what I can tell from taking a look at the
sprinter-sexp.c’s sexp_string() function, the code leaks the
recipients_string as well as the date string.

4 years agobuild: replace remaining uses of SHA1_FILE 0.24
David Bremner [Mon, 13 Mar 2017 01:31:16 +0000 (22:31 -0300)]
build: replace remaining uses of SHA1_FILE

oops. If only there was some editor facility that allowed replacing
all instances of a string.

4 years agodebian: changelog stanza for 0.24-1
David Bremner [Mon, 13 Mar 2017 01:15:05 +0000 (22:15 -0300)]
debian: changelog stanza for 0.24-1

4 years agoNEWS: set release date
David Bremner [Mon, 13 Mar 2017 01:10:36 +0000 (22:10 -0300)]
NEWS: set release date

4 years agoversion: bump to 0.24
David Bremner [Mon, 13 Mar 2017 01:08:54 +0000 (22:08 -0300)]
version: bump to 0.24

4 years agodebian: changelog stanza for 0.24~rc1-1 0.24_rc1 debian/0.24_rc1-1
David Bremner [Wed, 8 Mar 2017 12:10:11 +0000 (08:10 -0400)]
debian: changelog stanza for 0.24~rc1-1

4 years agoversion: bump version to 0.24~rc1
David Bremner [Wed, 8 Mar 2017 12:04:42 +0000 (08:04 -0400)]
version: bump version to 0.24~rc1

4 years agolib: Fix RegexpPostingSource
Olly Betts [Tue, 7 Mar 2017 12:52:39 +0000 (08:52 -0400)]
lib: Fix RegexpPostingSource

Remove incorrect skipping to first match from init(), and add explicit
skip_to() and check() methods to work around xapian-core bug (the
check() method will also improve speed when filtering by one of
these).

4 years agoNEWS: notmuch-emacs-mua and desktop integration
Jani Nikula [Mon, 6 Mar 2017 19:27:01 +0000 (21:27 +0200)]
NEWS: notmuch-emacs-mua and desktop integration

4 years agoNEWS: external subcommand handling
Jani Nikula [Mon, 6 Mar 2017 19:27:00 +0000 (21:27 +0200)]
NEWS: external subcommand handling

4 years agoman: document external subcommand handling in notmuch(1)
Jani Nikula [Mon, 6 Mar 2017 19:26:59 +0000 (21:26 +0200)]
man: document external subcommand handling in notmuch(1)

The documentation for this was overlooked when adding the subcommand
handling. This seems like the proper place for it.

4 years agoNEWS for emacs
Mark Walters [Mon, 6 Mar 2017 08:49:20 +0000 (08:49 +0000)]
NEWS for emacs

4 years agodebian: add two new exception symbols. 0.24_rc0 debian/0.24_rc0-1
David Bremner [Mon, 6 Mar 2017 00:13:06 +0000 (20:13 -0400)]
debian: add two new exception symbols.

It seems these need to be exported from the library in order for
exception handling to work.

4 years agoNEWS: start NEWS for 0.24
David Bremner [Sun, 5 Mar 2017 23:44:33 +0000 (19:44 -0400)]
NEWS: start NEWS for 0.24

4 years agodebian: start changelog stanza for 0.24~rc0-1
David Bremner [Sun, 5 Mar 2017 23:33:50 +0000 (19:33 -0400)]
debian: start changelog stanza for 0.24~rc0-1

4 years agoversion: bump to 0.24~rc0
David Bremner [Sun, 5 Mar 2017 23:30:21 +0000 (19:30 -0400)]
version: bump to 0.24~rc0

4 years agotest: shrink T590-thread-breakage test decription to one line
Jani Nikula [Sun, 26 Feb 2017 17:36:48 +0000 (19:36 +0200)]
test: shrink T590-thread-breakage test decription to one line

The test description is used for log output, I think the intention is
to keep it as a one-liner. Leave the rest of the long description as a
comment.

4 years agoemacs: compat: backport fix for folding long headers when sending
Mark Walters [Sat, 4 Mar 2017 20:42:14 +0000 (20:42 +0000)]
emacs: compat: backport fix for folding long headers when sending

This backports the fix from emacs master (commit
77bbca8c82f6e553c42abbfafca28f55fc995d00) to notmuch-emacs to wrap
long headers.

This fixes the test introduced in the previous changeset.

4 years agoTest: emacs: test for folding long headers.
Mark Walters [Sat, 4 Mar 2017 20:42:13 +0000 (20:42 +0000)]
Test: emacs: test for folding long headers.

Headers of more than 998 characters should be folded when sending.
However, until recently, emacs did not do this.

This adds a (known broken) test for this when sending messages in
emacs. We will backport the fix to notmuch-emacs in the next
changeset.

4 years agolib: query make exclude handling non-destructive
David Bremner [Sat, 25 Feb 2017 16:09:13 +0000 (12:09 -0400)]
lib: query make exclude handling non-destructive

We filter added exclude at add time, rather than modifying the query by
count search. As noted in the comments, there are several ignored
conditions here.

4 years agolib: centralize query parsing, store results.
David Bremner [Sat, 25 Feb 2017 16:09:11 +0000 (12:09 -0400)]
lib: centralize query parsing, store results.

The main goal is to prepare the way for non-destructive (or at least
less destructive) exclude tag handling. It does this by having a
pre-parsed query available for further processing. This also allows us
to provide slightly more precise error messages.

4 years agolib: use delete[] to free buffer allocated using new[]
Jani Nikula [Sat, 4 Mar 2017 17:38:41 +0000 (19:38 +0200)]
lib: use delete[] to free buffer allocated using new[]

Fix warning caught by clang:

lib/regexp-fields.cc:41:2: warning: 'delete' applied to a pointer that was allocated
      with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
        delete buffer;
        ^
              []
lib/regexp-fields.cc:37:17: note: allocated with 'new[]' here
        char *buffer = new char[len];
                       ^

4 years agolib: add mid: as a synonym for id:
David Bremner [Mon, 27 Feb 2017 02:34:21 +0000 (22:34 -0400)]
lib: add mid: as a synonym for id:

mid: is the url scheme suggested by URL 2392. We also plan to
introduce more flexible searches for mid: than are possible with
id: (in order not to break assumptions about the special behaviour of
id:, e.g. identifying at most one message).

4 years agolib: regexp matching in 'subject' and 'from'
David Bremner [Mon, 27 Feb 2017 02:34:20 +0000 (22:34 -0400)]
lib: regexp matching in 'subject' and 'from'

the idea is that you can run

% notmuch search subject:/<your-favourite-regexp>/
% notmuch search from:/<your-favourite-regexp>/

or

% notmuch search subject:"your usual phrase search"
% notmuch search from:"usual phrase search"

This feature is only available with recent Xapian, specifically
support for field processors is needed.

It should work with bindings, since it extends the query parser.

This is easy to extend for other value slots, but currently the only
value slots are date, message_id, from, subject, and last_mod. Date is
already searchable;  message_id is left for a followup commit.

This was originally written by Austin Clements, and ported to Xapian
field processors (from Austin's custom query parser) by yours truly.

4 years agolib: create field processors from prefix table
David Bremner [Mon, 27 Feb 2017 02:34:19 +0000 (22:34 -0400)]
lib: create field processors from prefix table

This is a bit more code than hardcoding the two existing field
processors, but it should make it easy to add more.

4 years agobuild: use sha256sum instead of sha1sum to sign releases
David Bremner [Thu, 2 Mar 2017 00:44:47 +0000 (20:44 -0400)]
build: use sha256sum instead of sha1sum to sign releases

4 years agoemacs/desktop: update to use notmuch-emacs-mua and handle mailto
Jani Nikula [Sat, 25 Feb 2017 09:25:40 +0000 (11:25 +0200)]
emacs/desktop: update to use notmuch-emacs-mua and handle mailto

With the mailto: handling in notmuch-emacs-mua, we can update the
desktop file to advertize we can be set as the default application to
handle email. While at it, add GenericName and Comment to be more
informative.

With --hello, notmuch-emacs-mua will run (notmuch) if mailto: url is
not given.

4 years agocompletion: complete notmuch emacs-mua
Jani Nikula [Sat, 25 Feb 2017 09:25:39 +0000 (11:25 +0200)]
completion: complete notmuch emacs-mua

With subcommand handling for external commands we can easily complete
'notmuch emacs-mua' using the existing completion system.

4 years agoMerge branch 'release'
David Bremner [Wed, 1 Mar 2017 01:21:07 +0000 (21:21 -0400)]
Merge branch 'release'

Second gnugpg test suite fix

4 years agoupdate version to 0.23.7 0.23.7
David Bremner [Wed, 1 Mar 2017 00:49:24 +0000 (20:49 -0400)]
update version to 0.23.7

4 years agoNEWS: add news for 0.23.7
David Bremner [Wed, 1 Mar 2017 00:46:53 +0000 (20:46 -0400)]
NEWS: add news for 0.23.7

4 years agoadd changelog stanza for 0.23.7-1
David Bremner [Tue, 28 Feb 2017 00:07:52 +0000 (20:07 -0400)]
add changelog stanza for 0.23.7-1

4 years agonotmuch-config: ENOENT vs generic handling when file open fails.
Tomi Ollila [Sun, 26 Feb 2017 19:12:39 +0000 (21:12 +0200)]
notmuch-config: ENOENT vs generic handling when file open fails.

When opening configuration file fails, ENOENT (file not found) is
handled specially -- in setup missing file is ok (often expected),
and otherwise user can be informed to run notmuch setup.

In any other case the the reason is unknown, so there is no other
option but to print generic error message to stderr.

4 years agocli/config: don't try to open config file for 'notmuch help'
Jani Nikula [Sun, 26 Feb 2017 19:12:38 +0000 (21:12 +0200)]
cli/config: don't try to open config file for 'notmuch help'

The help command does not really need to try to open the config
file. So don't.

4 years agoMerge tag '0.23.6'
David Bremner [Tue, 28 Feb 2017 12:06:42 +0000 (08:06 -0400)]
Merge tag '0.23.6'

notmuch 0.23.6 release

4 years agocli/show: add content-disposition to structured output message parts
Jani Nikula [Sun, 26 Feb 2017 18:33:48 +0000 (20:33 +0200)]
cli/show: add content-disposition to structured output message parts

Help the clients decide how to display parts.

Test updates by Mark Walters <markwalters1009@gmail.com>.
One more test fix by db

4 years agocli/show: abstract get content disposition
Jani Nikula [Sun, 26 Feb 2017 18:33:47 +0000 (20:33 +0200)]
cli/show: abstract get content disposition

Reduce duplication in follow-up work. As a side effect, handle error
returns from g_mime_content_disposition_get_disposition() without
segfaulting.

4 years agotest: move GNUPGHOME to TEST_TMPDIR
David Bremner [Mon, 27 Feb 2017 23:53:56 +0000 (19:53 -0400)]
test: move GNUPGHOME to TEST_TMPDIR

We already use this directory for dtach sockets, so it makes sense to
put gnupg sockets there as well. There doesn't seem to be a clean way
to put a fully functional socket in a different location than
GNUPGHOME.

4 years agoRevert "configure: add test for gpgconf --create-socketdir"
David Bremner [Mon, 27 Feb 2017 22:27:49 +0000 (18:27 -0400)]
Revert "configure: add test for gpgconf --create-socketdir"

This reverts commit 12f7d4e61d30fb9a5c99e128ab1aab0bf069cdb4.

Since we're not using gpgconf anymore, drop the unneeded test in
configure.

4 years agoRevert "test: use gpgconf --create-socketdir if available"
David Bremner [Mon, 27 Feb 2017 22:26:47 +0000 (18:26 -0400)]
Revert "test: use gpgconf --create-socketdir if available"

This reverts commit e7b88e8b0a93ca83d807edc00e0c97af54c5b5f1.

It turns out that this does not work well in environments without a
running systemd (or some other provider of /run/user)

4 years agodebian: set upload date and suite 0.23.6
David Bremner [Mon, 27 Feb 2017 10:58:07 +0000 (06:58 -0400)]
debian: set upload date and suite

4 years agoNEWS: set release date
David Bremner [Mon, 27 Feb 2017 10:57:42 +0000 (06:57 -0400)]
NEWS: set release date

4 years agotest: make T640 compatible with old C compilers
David Bremner [Sun, 26 Feb 2017 12:16:45 +0000 (08:16 -0400)]
test: make T640 compatible with old C compilers

Apparently our test system does not use the same flags for compiling
tests as it does for compiling notmuch. Make the test compatible with
C89. Also remove one unused loop index.

4 years agocompletion: add bash completion for query: and property:
Jani Nikula [Sat, 17 Dec 2016 10:50:49 +0000 (12:50 +0200)]
completion: add bash completion for query: and property:

Add prefix completion for query and property, with value completion
for query. Apparently there's no way to get at the available
properties in the cli.

4 years agoemacs: show: stop display of application/* parts
Mark Walters [Sat, 28 Jan 2017 09:47:42 +0000 (09:47 +0000)]
emacs: show: stop display of application/* parts

Gnus seems to display application/zip and application/tar by
default. This doesn't seem desirable so we override it.

We only override if the user has not customized
mm-inline-override-types themselves.

4 years agotest: test format version difference between v2 and v3
Jani Nikula [Sat, 25 Feb 2017 13:31:32 +0000 (15:31 +0200)]
test: test format version difference between v2 and v3

Schemata v3 changed message filename field to a list. Test both
versions 2 and 3.

4 years agocli/show: list all filenames of a message in the formatted output
Jani Nikula [Sat, 25 Feb 2017 13:31:31 +0000 (15:31 +0200)]
cli/show: list all filenames of a message in the formatted output

Instead of just having the first filename for the message, list all
duplicate filenames of the message as a list in the formatted
outputs. This bumps the format version to 3.

4 years agoemacs: use (system-name) instead of system-name
Jani Nikula [Sun, 26 Feb 2017 09:28:30 +0000 (11:28 +0200)]
emacs: use (system-name) instead of system-name

Fix the deprecation warning:

In notmuch-maildir-fcc-make-uniq-maildir-id:
emacs/notmuch-maildir-fcc.el:279:53:Warning: ‘system-name’ is an obsolete
    variable (as of 25.1); use (system-name) instead

I've used (system-name) since at least 2011, so it must have been
around quite a while.

4 years agolib/message.cc: use view number to invalidate cached metadata
David Bremner [Fri, 24 Feb 2017 18:33:07 +0000 (14:33 -0400)]
lib/message.cc: use view number to invalidate cached metadata

Currently the view number is incremented by notmuch_database_reopen

4 years agolib: handle DatabaseModifiedError in _n_message_ensure_metadata
David Bremner [Sat, 18 Feb 2017 01:28:05 +0000 (21:28 -0400)]
lib: handle DatabaseModifiedError in _n_message_ensure_metadata

The retries are hardcoded to a small number, and error handling aborts
than propagating errors from notmuch_database_reopen. These are both
somewhat justified by the assumption that most things that can go
wrong in Xapian::Database::reopen are rare and fatal. Here's the brief
discussion with Xapian upstream:

   24-02-2017 08:12:57 < bremner> any intuition about how likely
      Xapian::Database::reopen is to fail? I'm catching a
      DatabaseModifiedError somewhere where handling any further errors is
      tricky, and wondering about treating a failed reopen as as "the
      impossible happened, stopping"

   24-02-2017 16:22:34 < olly> bremner: there should not be much scope for
    failure - stuff like out of memory or disk errors, which are probably a
    good enough excuse to stop

4 years agolib: add _notmuch_database_reopen
David Bremner [Fri, 24 Feb 2017 01:38:24 +0000 (21:38 -0400)]
lib: add _notmuch_database_reopen

The main expected use is to recover from a Xapian::DatabaseChanged
exception.

4 years agotest: add known broken test for uncaught DatabaseModifiedError
David Bremner [Sat, 25 Feb 2017 02:57:40 +0000 (22:57 -0400)]
test: add known broken test for uncaught DatabaseModifiedError

There are several of these to track down, but one that is in quite a
few code paths is _notmuch_message_ensure_metadata.

4 years agodebian: note read-after-free fix in d/changelog
David Bremner [Sat, 25 Feb 2017 12:48:10 +0000 (08:48 -0400)]
debian: note read-after-free fix in d/changelog

4 years agoNEWS: document read-after-free bugfix
David Bremner [Sat, 25 Feb 2017 12:45:43 +0000 (08:45 -0400)]
NEWS: document read-after-free bugfix

4 years agoMerge branch 'release'
David Bremner [Thu, 23 Feb 2017 13:08:15 +0000 (09:08 -0400)]
Merge branch 'release'

Merge in g_hash_table read-after-free fix

4 years agoversion: bump to 0.23.6
David Bremner [Thu, 23 Feb 2017 13:03:10 +0000 (09:03 -0400)]
version: bump to 0.23.6

python and debian bumped at the same time

4 years agotest: replaced use of python with $NOTMUCH_PYTHON (twice)
Tomi Ollila [Wed, 4 Jan 2017 21:33:15 +0000 (23:33 +0200)]
test: replaced use of python with $NOTMUCH_PYTHON (twice)

$NOTMUCH_PYTHON is sourced from sh.config, configured by
./configure and stated to be used as:

"Name of python command to use in configure and the test suite."

4 years agoemacs: company: remove two build warnings
Mark Walters [Sat, 28 Jan 2017 10:19:58 +0000 (10:19 +0000)]
emacs: company: remove two build warnings

This adds two defvars to avoid two build warnings in the notmuch emacs
code. These were both introduced (by me) in commit 827c28a0.

4 years agoemacs: fully add the notmuch-address customize group
Mark Walters [Sat, 28 Jan 2017 10:38:27 +0000 (10:38 +0000)]
emacs: fully add the notmuch-address customize group

We now have several customizable options for address completion. There
is a customize group notmuch-address but it only contains one of these
options. Add all the others, and make it part of the notmuch customize
group.

4 years agolib: make _notmuch_message_ensure_property_map static
David Bremner [Sat, 18 Feb 2017 14:45:48 +0000 (10:45 -0400)]
lib: make _notmuch_message_ensure_property_map static

It's not called outside message.cc

4 years agolib: make _notmuch_message_ensure_metadata static
David Bremner [Sat, 18 Feb 2017 14:45:44 +0000 (10:45 -0400)]
lib: make _notmuch_message_ensure_metadata static

It's not called anywhere outside message.cc.

4 years agolib: fix g_hash_table related read-after-free bug
David Bremner [Wed, 22 Feb 2017 10:17:47 +0000 (06:17 -0400)]
lib: fix g_hash_table related read-after-free bug

The two g_hash_table functions (insert, add) have different behaviour
with respect to existing keys. g_hash_table_insert frees the new key,
while g_hash_table_add (which is really g_hash_table_replace in
disguise) frees the existing key. With this change 'ref' is live until
the end of the function (assuming single-threaded access to
'hash'). We can't guarantee it will continue to be live in the
future (i.e. there may be a future key duplication) so we copy it with
the allocation context passed to parse_references (in practice this is
the notmuch_message_t object whose parents we are finding).

Thanks to Tomi for the simpler approach to the problem based on
reading the fine glib manual.

4 years agoMerge branch 'release'
David Bremner [Tue, 21 Feb 2017 12:16:07 +0000 (08:16 -0400)]
Merge branch 'release'

Merge changes to use gpgconf --create-socketdir

4 years agodebian: start changelog for 0.23.6
David Bremner [Tue, 21 Feb 2017 11:51:44 +0000 (07:51 -0400)]
debian: start changelog for 0.23.6

4 years agoNEWS: news for gpgconf use in test suite
David Bremner [Tue, 21 Feb 2017 11:50:05 +0000 (07:50 -0400)]
NEWS: news for gpgconf use in test suite

4 years agotest: use gpgconf --create-socketdir if available
David Bremner [Tue, 14 Feb 2017 21:42:39 +0000 (16:42 -0500)]
test: use gpgconf --create-socketdir if available

This enables the shortened socket pathes in /run or equivalent. The
explicit call to gpgconf is needed for nonstandard GNUPGHOME settings.

(amended according to id:m2fujatr4k.fsf@guru.guru-group.fi)

4 years agoconfigure: add test for gpgconf --create-socketdir
David Bremner [Tue, 14 Feb 2017 21:42:38 +0000 (16:42 -0500)]
configure: add test for gpgconf --create-socketdir

This is primarily intended for use in the test suite (since notmuch
builds fine without gnupg installed). Thus we only write the variable
to sh.config.

4 years agolib: Let Xapian manage the memory for FieldProcessors
David Bremner [Fri, 17 Feb 2017 03:07:50 +0000 (23:07 -0400)]
lib: Let Xapian manage the memory for FieldProcessors

It turns out this is exactly what release() is for; Xapian will
deallocate the objects when it's done with them.

4 years agolib: merge internal prefix tables
David Bremner [Fri, 17 Feb 2017 03:07:49 +0000 (23:07 -0400)]
lib: merge internal prefix tables

Replace multiple tables with some flags in a single table. This makes
the code in notmuch_database_open_verbose a bit shorter, and it should
also make it easier to add other options to fields, e.g. regexp
searching.

4 years agoemacs: address: save hash
Mark Walters [Sun, 20 Nov 2016 16:50:34 +0000 (16:50 +0000)]
emacs: address: save hash

This allows the user to save the address hash so that it is much
faster for the first completion after a restart. This defaults to off
as there are privacy implications to saving this information.

The code tries hard to avoid overwriting the wrong file. It also notes
if changes have been made to any of the relevant user settings, so
that the user does not get surprising results (i.e., outdated options
being used). Finally it stores some version information so that is
easy for us to update the format of the save file.

4 years agoemacs: address: move address-full-harvest-finished to a function
Mark Walters [Sun, 20 Nov 2016 16:50:33 +0000 (16:50 +0000)]
emacs: address: move address-full-harvest-finished to a function

This makes the code access notmuch-address-full-harvest-finished via a
helper function, notmuch-address--harvest-ready. Later we will use
this to check whether we can load the harvest instead of regenerating
it.

4 years agocli: don't call _entry_in_ignore_list twice in count files debug
Jani Nikula [Sat, 17 Dec 2016 16:28:43 +0000 (18:28 +0200)]
cli: don't call _entry_in_ignore_list twice in count files debug

Split file ignores in count_files to fixed and user configured in
order to not have to call _entry_in_ignore_list twice when debugging
is enabled. Minor detail.

4 years agotest: wrap 'wc -l' results in arithmetic evaluation to strip whitespace
Tomi Ollila [Wed, 4 Jan 2017 22:35:23 +0000 (00:35 +0200)]
test: wrap 'wc -l' results in arithmetic evaluation to strip whitespace

Some new unwrapped 'wc -l's have been added since Jani's 60e79e3a9f1c8