[RFC PATCH 07/13] notmuch-new: pull out useful bits of add_files_recursive

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp <et...@betacantrips.com> This is part of notmuch-new refactor phase 1: make add_files stuff safe for other backends. add_files_recursive is essentially a maildir-crawling function that periodically adds files to the database or adds filenames to remove

[RFC PATCH 06/13] Pass mailstore to _notmuch_message_index_file

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp <et...@betacantrips.com> This is the last place where fopen(2) was used and had to be replaced. Signed-off-by: Ethan Glasser-Camp --- lib/database.cc |2 +- lib/index.cc |5 +++-- lib/notmuch-private.h |3 ++- 3 files changed, 6 inse

[RFC PATCH 04/13] Replace remaining places where fopen occurs

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp <et...@betacantrips.com> Because mail might no longer be on disk, other uses of fopen(2) need to be replaced with calls to notmuch_mailstore_open. This isn't all of them, but these are the ones that involve touching the API in a lot of different places. This

[RFC PATCH 03/13] Introduce mailstore in the python bindings

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp <et...@betacantrips.com> Signed-off-by: Ethan Glasser-Camp --- bindings/python/notmuch/database.py | 31 +- bindings/python/notmuch/globals.py |3 ++ bindings/python/notmuch/mailstore.py | 38 +++

[RFC PATCH 02/13] Add the concept of a mailstore in its absolute minimal sense

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp <et...@betacantrips.com> This introduces (and uses) the mailstore parameter to the notmuch_message_file_open API, and passes this through wherever it will be needed. This requires touching a lot of places just to change one API. We end up

[RFC PATCH 01/13] Create configuration paramater database.type

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp <et...@betacantrips.com> This will be used to allow different backends to be developed to allow access to mail that isn't stored in Maildirs. Signed-off-by: Ethan Glasser-Camp --- notmuch-client.h |7 ++ notmuch-config.c

[RFC PATCH 00/13] Modular message store code

2012-02-15 Thread Ethan Glasser-Camp
me coming from Python. - If I'm already touching code, should I add other drive-by fixes, as in patch 05, or should I resolutely refuse to change anything, as in patch 07? - Should something like the CouchDB backend be optional, and if so, what mechanisms do I need to use to make that happen? Thanks so much for your time! Ethan

[RFC PATCH 00/13] Modular message store code

2012-02-15 Thread Ethan Glasser-Camp
anything, as in patch 07? - Should something like the CouchDB backend be optional, and if so, what mechanisms do I need to use to make that happen? Thanks so much for your time! Ethan ___ notmuch mailing list notmuch@notmuchmail.org http

[RFC PATCH 01/13] Create configuration paramater database.type

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com This will be used to allow different backends to be developed to allow access to mail that isn't stored in Maildirs. Signed-off-by: Ethan Glasser-Camp et...@betacantrips.com --- notmuch-client.h |7 ++ notmuch-config.c | 57

[RFC PATCH 02/13] Add the concept of a mailstore in its absolute minimal sense

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com This introduces (and uses) the mailstore parameter to the notmuch_message_file_open API, and passes this through wherever it will be needed. This requires touching a lot of places just to change one API. We end up adding it to the notmuch_database_t

[RFC PATCH 03/13] Introduce mailstore in the python bindings

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com Signed-off-by: Ethan Glasser-Camp et...@betacantrips.com --- bindings/python/notmuch/database.py | 31 +- bindings/python/notmuch/globals.py |3 ++ bindings/python/notmuch/mailstore.py | 38

[RFC PATCH 04/13] Replace remaining places where fopen occurs

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com Because mail might no longer be on disk, other uses of fopen(2) need to be replaced with calls to notmuch_mailstore_open. This isn't all of them, but these are the ones that involve touching the API in a lot of different places. This commit updates

[RFC PATCH 05/13] notmuch_database_add_message calculates sha1 of messages using mailstore

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com Previously, notmuch_database_add_message used the notmuch_sha1_of_file function, which accesses a mail file directly. Create a new function called notmuch_sha1_of_message which uses a mailstore to access the file, and use that instead. Also

[RFC PATCH 06/13] Pass mailstore to _notmuch_message_index_file

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com This is the last place where fopen(2) was used and had to be replaced. Signed-off-by: Ethan Glasser-Camp et...@betacantrips.com --- lib/database.cc |2 +- lib/index.cc |5 +++-- lib/notmuch-private.h |3 ++- 3 files

[RFC PATCH 07/13] notmuch-new: pull out useful bits of add_files_recursive

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com This is part of notmuch-new refactor phase 1: make add_files stuff safe for other backends. add_files_recursive is essentially a maildir-crawling function that periodically adds files to the database or adds filenames to remove_files

[RFC PATCH 08/13] count_files and add_files shall be generic

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com Rename current count_files and add_files to maildir_count_files and maildir_add_files. This allows the possibility, at least, of having other backends. Signed-off-by: Ethan Glasser-Camp et...@betacantrips.com --- notmuch-new.c | 62

[RFC PATCH 09/13] Mailstore also provides a rename function

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com This is used only in notmuch_message_tags_to_maildir_flags, to update a message's filename when its tags change. For mailstores where this doesn't make sense, they can of course define rename to be a NOOP. Signed-off-by: Ethan Glasser-Camp et

[RFC PATCH 10/13] Introduce concept of mailstore constructor

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com Right now this is a fancy no-op because maildir doesn't need any special data, but getting the API right is good. A constructor can fail, so return a notmuch_status_t. Signed-off-by: Ethan Glasser-Camp et...@betacantrips.com --- lib/mailstore.c

[RFC PATCH 11/13] Add a close function to mailstore

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com This is a useful way to signal to mailstores that the resources associated with an existing FILE* are no longer being used and they can be cleaned up. For maildir, of course, this is just a call to fclose(), but for other mailstores this might

[RFC PATCH 12/13] Close files using notmuch_mailstore_close instead of fclose

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com This requires a little bit of juggling in lib/sha1.c. Wrapper functions provide the FILE*. Instead of closing the file immediately ourselves, we let the wrapper functions close it. Signed-off-by: Ethan Glasser-Camp et...@betacantrips.com --- lib

[RFC PATCH 13/13] First crack at a CouchDB mailstore

2012-02-15 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com This introduces new parameters to notmuch-config to store the CouchDB URL and the name of the database. Signed-off-by: Ethan Glasser-Camp et...@betacantrips.com --- Makefile.local |3 + lib/mailstore.c | 109

[PATCH] Free the results of scandir()

2012-02-07 Thread Ethan Glasser-Camp
On 02/07/2012 05:10 AM, Dmitry Kurochkin wrote: > Please use --subject-prefix='PATCH vN' parameter when sending new > versions of patches. Also, sending new versions as replies to the first > email in the original thread makes it easier to track. Oops! Thanks again. Ethan

[PATCH] Free the results of scandir()

2012-02-07 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp <et...@betacantrips.com> scandir() returns "strings allocated via malloc(3)" which are then "collected in array namelist which is allocated via malloc(3)". Currently we just free the array namelist. Instead, free all the entries of namelist, and

[PATCH v2] Free the results of scandir()

2012-02-07 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp <et...@betacantrips.com> scandir() returns "strings allocated via malloc(3)" which are then "collected in array namelist which is allocated via malloc(3)". Currently we just free the array namelist. Instead, free all the entries of namelist, and

[PATCH] Free the results of scandir()

2012-02-07 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com scandir() returns strings allocated via malloc(3) which are then collected in array namelist which is allocated via malloc(3). Currently we just free the array namelist. Instead, free all the entries of namelist, and then free namelist. entry only

Re: [PATCH] Free the results of scandir()

2012-02-07 Thread Ethan Glasser-Camp
On 02/07/2012 05:10 AM, Dmitry Kurochkin wrote: Please use --subject-prefix='PATCH vN' parameter when sending new versions of patches. Also, sending new versions as replies to the first email in the original thread makes it easier to track. Oops! Thanks again. Ethan

[PATCH] Free the results of scandir()

2012-02-06 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp <et...@betacantrips.com> scandir() returns "strings allocated via malloc(3)" which are then "collected in array namelist which is allocated via malloc(3)". Currently we just free the array namelist. Instead, free all the entries of namelist, and

[PATCH] Free the results of scandir()

2012-02-06 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com scandir() returns strings allocated via malloc(3) which are then collected in array namelist which is allocated via malloc(3). Currently we just free the array namelist. Instead, free all the entries of namelist, and then free namelist. entry only

[PATCH 1/2] moved _notmuch_get_list () and _notmuch_set_list () up in file

2012-01-27 Thread Ethan Glasser-Camp
ion is acceptable but I found "in further work" a little odd. (Depending on what you meant, I'd say "in upcoming patches".) The thing I found most confusing about the comment is that the functions aren't called _notmuch_get_list or _notmuch_set_list (instead they are _config_get_list and _config_set_list.) Ethan

Re: [PATCH 1/2] moved _notmuch_get_list () and _notmuch_set_list () up in file

2012-01-27 Thread Ethan Glasser-Camp
in upcoming patches.) The thing I found most confusing about the comment is that the functions aren't called _notmuch_get_list or _notmuch_set_list (instead they are _config_get_list and _config_set_list.) Ethan ___ notmuch mailing list notmuch

[PATCH v2] Document external dependencies in the test suite

2012-01-16 Thread Ethan Glasser-Camp
ite, I just followed Dmitry's suggestion. Ethan

[PATCH v2] Document external dependencies in the test suite

2012-01-16 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp <et...@betacantrips.com> Add an explicit note to the README explaining what programs are necessary and the perhaps-surprising behavior of skipping tests if they aren't present. Signed-off-by: Ethan Glasser-Camp --- v2 suggested by Dmitry Kurochkin: docume

[PATCH] Document the dependency on dtach in the test suite

2012-01-16 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp <et...@betacantrips.com> dtach (and before that, screen) are used to run emacs with more verisimilitude, but this is only mentioned in the NEWS. Mention this in the test/README file, to make it easier to find out why a bunch of tests are failing/skipped. Sign

[PATCH v2] Document external dependencies in the test suite

2012-01-16 Thread Ethan Glasser-Camp
From: Ethan Glasser-Camp et...@betacantrips.com Add an explicit note to the README explaining what programs are necessary and the perhaps-surprising behavior of skipping tests if they aren't present. Signed-off-by: Ethan Glasser-Camp et...@betacantrips.com --- v2 suggested by Dmitry Kurochkin

Distributed Notmuch

2012-01-08 Thread Ethan Glasser-Camp
ig for me, and despite Nicolas Sebrecht and Sebastian Spaeth's heroic work on OfflineIMAP, it still uses a lot of bandwidth to sync. And obviously the whole point of this exercise is tag synchronization.. Ethan

Distributed Notmuch

2012-01-08 Thread Ethan Glasser-Camp
, and despite Nicolas Sebrecht and Sebastian Spaeth's heroic work on OfflineIMAP, it still uses a lot of bandwidth to sync. And obviously the whole point of this exercise is tag synchronization.. Ethan ___ notmuch mailing list notmuch@notmuchmail.org http

notmuch release 0.5 now available

2010-11-18 Thread Ethan Glasser-Camp
se will be automatically removed). And of course, there > are various fixes and improvements throughout. See below for details. Hi guys, I know I'm late to the party, but I just wanted to say I've been playing with notmuch 0.5 and the synchronization stuff works great. Great job guys! Ethan

Re: notmuch release 0.5 now available

2010-11-18 Thread Ethan Glasser-Camp
). And of course, there are various fixes and improvements throughout. See below for details. Hi guys, I know I'm late to the party, but I just wanted to say I've been playing with notmuch 0.5 and the synchronization stuff works great. Great job guys! Ethan

notmuch synchronization

2010-10-05 Thread Ethan Glasser-Camp
on this subject was at: http://notmuchmail.org/pipermail/notmuch/2010/002119.html) Ethan

<    1   2   3