<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/lib/database.cc, branch 0.22</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=0.22</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=0.22'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2016-04-12T23:46:42Z</updated>
<entry>
<title>lib: clean up _notmuch_database_split_path</title>
<updated>2016-04-12T23:46:42Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2016-04-10T19:43:23Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=54aeab1962d77455a65d0d4338beaabbb936310f'/>
<id>urn:sha1:54aeab1962d77455a65d0d4338beaabbb936310f</id>
<content type='text'>
Make the logic it a bit easier to read. No functional changes.
</content>
</entry>
<entry>
<title>lib: fix handling of one character long directory names at top level</title>
<updated>2016-04-12T23:40:19Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2016-04-10T19:43:22Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=a352d9ceaa7e08b7c9de294419ec4c323b81ca15'/>
<id>urn:sha1:a352d9ceaa7e08b7c9de294419ec4c323b81ca15</id>
<content type='text'>
The code to skip multiple slashes in _notmuch_database_split_path()
skips back one character too much. This is compensated by a +1 in the
length parameter to the strndup() call. Mostly this works fine, but if
the path is to a file under a top level directory with one character
long name, the directory part is mistaken to be part of the file name
(slash == path in code). The returned directory name will be the empty
string and the basename will be the full path, breaking the indexing
logic in notmuch new.

Fix the multiple slash skipping to keep the slash variable pointing at
the last slash, and adjust strndup() accordingly.

The bug was introduced in

commit e890b0cf4011fd9fd77ebd87343379e4a778888b
Author: Carl Worth &lt;cworth@cworth.org&gt;
Date:   Sat Dec 19 13:20:26 2009 -0800

    database: Store the parent ID for each directory document.

just a little over two months after the initial commit in the Notmuch
code history, making this the longest living bug in Notmuch to date.
</content>
</entry>
<entry>
<title>forbid atomic transactions on writable, upgradable databases</title>
<updated>2015-11-23T12:15:37Z</updated>
<author>
<name>Steven Allen</name>
<email>steven@stebalien.com</email>
</author>
<published>2015-10-25T21:30:39Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=c946356cdc026b6d65662075487eb058f5c96c2b'/>
<id>urn:sha1:c946356cdc026b6d65662075487eb058f5c96c2b</id>
<content type='text'>
We can't (but currently do) allow upgrades within transactions because
upgrades need their own transactions. We don't want to re-use the
current transaction because bailing out of an upgrade would mean loosing
all previous changes (because our "atomic" transactions don't commit
before hand). This gives us two options:

1. Fail at the beginning of upgrade (tell the user to end the
   transaction, upgrade, and start over).
2. Don't allow the user to start the transaction.

I went with the latter because:

1. There is no reason to call `begin_atomic` unless you intend to to
   write to the database and anyone intending to write to the database
   should upgrade it first.
2. This means that nothing inside an atomic transaction can ever fail
   with NOTMUCH_STATUS_UPGRADE_REQUIRED.
</content>
</entry>
<entry>
<title>lib: migrate notmuch_database_upgrade to new query_search API</title>
<updated>2015-10-05T22:53:11Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2015-09-27T15:32:01Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=2501c2565ccca19e3e49fa1594aaa90f04e37d6d'/>
<id>urn:sha1:2501c2565ccca19e3e49fa1594aaa90f04e37d6d</id>
<content type='text'>
Here we depend on the error path cleaning up query
</content>
</entry>
<entry>
<title>lib: add versions of n_q_count_{message,threads} with status return</title>
<updated>2015-10-05T22:44:07Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2015-09-27T15:31:57Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=87ee9a53e36f395e73e16da12cb268a708147259'/>
<id>urn:sha1:87ee9a53e36f395e73e16da12cb268a708147259</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>lib: move query variable to function scope</title>
<updated>2015-10-05T22:39:11Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2015-09-27T15:31:55Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=65a6b86873a471bb87d30a8617a87857103cd8b6'/>
<id>urn:sha1:65a6b86873a471bb87d30a8617a87857103cd8b6</id>
<content type='text'>
This is a prelude to deallocating it (if necessary) on the error path.
</content>
</entry>
<entry>
<title>lib: constify argument to notmuch_database_status_string</title>
<updated>2015-09-04T11:24:38Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2015-06-07T15:02:00Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=bd5504ec10edf6a1442d92774dc06fafc0b46e3f'/>
<id>urn:sha1:bd5504ec10edf6a1442d92774dc06fafc0b46e3f</id>
<content type='text'>
We don't modify the database struct, so no harm in committing to that.
</content>
</entry>
<entry>
<title>lib: note remaining uses of deprecated message search API</title>
<updated>2015-09-04T11:08:18Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2015-06-07T15:01:58Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=110694b00b79793b3c09a0349c0ff7608df551d6'/>
<id>urn:sha1:110694b00b79793b3c09a0349c0ff7608df551d6</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>lib: Add "lastmod:" queries for filtering by last modification</title>
<updated>2015-08-14T16:23:49Z</updated>
<author>
<name>Austin Clements</name>
<email>amdragon@mit.edu</email>
</author>
<published>2014-10-13T06:20:03Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=cb08a2ee019e52dc29ba393d139fce8d7282c632'/>
<id>urn:sha1:cb08a2ee019e52dc29ba393d139fce8d7282c632</id>
<content type='text'>
The implementation is essentially the same as the date range search
prior to Jani's fancy date parser.
</content>
</entry>
<entry>
<title>lib: API to retrieve database revision and UUID</title>
<updated>2015-08-13T21:52:51Z</updated>
<author>
<name>Austin Clements</name>
<email>aclements@csail.mit.edu</email>
</author>
<published>2014-10-13T06:20:02Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=98ee460eaa98f1428aecf03dd39fcf314e6f62c0'/>
<id>urn:sha1:98ee460eaa98f1428aecf03dd39fcf314e6f62c0</id>
<content type='text'>
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).
</content>
</entry>
</feed>
