[PATCH v2 01/11] test: fix compact backup / restore test

2013-11-03 Thread Jani Nikula
From: David Bremner It was looking in completely the wrong place for the backup and the (test) xapian database. Unfortunately test_begin_subtest hides the relevant errors. --- test/compact | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/compact b/test/compact inde

[PATCH v2 00/11] compactor changes v2

2013-11-03 Thread Jani Nikula
Hi all, this is v2 of [1], incorporating compact related patches from David, some changes from David's review, some new patches, man page update, test update. Cheers, Jani. [1] id:cover.1383315568.git.jani at nikula.org David Bremner (2): test: fix compact backup / restore test lib: update

[PATCH v2 03/11] lib: check talloc success in compact

2013-11-03 Thread Jani Nikula
In line with the allocation checks all around. --- lib/database.cc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/database.cc b/lib/database.cc index 3dfea0f..7a8702e 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -863,13 +863,17 @@ notmuch_database_compact (co

[PATCH v2 02/11] lib: construct compactor within try block to catch any exceptions

2013-11-03 Thread Jani Nikula
Constructors may also throw exceptions. Catch them. --- lib/database.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/database.cc b/lib/database.cc index 20e5ec2..3dfea0f 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -864,7 +864,6 @@ notmuch_database_compact (co

[PATCH v2 04/11] lib: do not leak the database in compaction

2013-11-03 Thread Jani Nikula
Destroy instead of close the database after compaction, and also on error path, to not leak the database. --- lib/database.cc | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/database.cc b/lib/database.cc index 7a8702e..eadf8a7 100644 --- a/lib/database.cc +++ b/lib/da

[PATCH v2 05/11] lib: add closure parameter to compact status update callback

2013-11-03 Thread Jani Nikula
This provides much more flexibility for the caller. --- lib/database.cc | 14 +- lib/notmuch.h | 5 +++-- notmuch-compact.c | 8 +++- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/database.cc b/lib/database.cc index eadf8a7..5a01703 100644 --- a/lib/d

[PATCH v2 06/11] lib: update documentation of callback functions for database_compact and database_upgrade.

2013-11-03 Thread Jani Nikula
From: David Bremner Compact was missing callback documentation entirely, and upgrade did not discuss the closure parameter. --- lib/notmuch.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/notmuch.h b/lib/notmuch.h index cd301a4..82fd599 100644 --- a/lib/notmuch.h

[PATCH v2 07/11] lib: use the compaction backup path provided by the caller

2013-11-03 Thread Jani Nikula
The extra path component added by the lib is a magic value that the caller just has to know. This is demonstrated by the current code, which indeed has "xapian.old" both sides of the interface. Use the backup path provided by the lib caller verbatim, without adding anything to it. --- v2: add xap

[PATCH v2 08/11] cli: return error status if compaction fails

2013-11-03 Thread Jani Nikula
As is customary for any tool. --- notmuch-compact.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/notmuch-compact.c b/notmuch-compact.c index 55dc731..b9461c2 100644 --- a/notmuch-compact.c +++ b/notmuch-compact.c @@ -43,16 +43,17 @@ notmuch_compact_comma

[PATCH v2 09/11] cli: add compact --backup=DIRECTORY option, don't backup by default

2013-11-03 Thread Jani Nikula
It's the user's decision. The recommended way is to do a database dump anyway. Clean up the relevant printfs too. --- v2: reorder prints --- notmuch-compact.c | 27 +-- test/compact | 4 ++-- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/notmuch-c

[PATCH v2 10/11] cli: add compact --verbose option and silence output without it

2013-11-03 Thread Jani Nikula
If there's nothing surprising to say, don't say anything. Unless asked for by the user. --- notmuch-compact.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/notmuch-compact.c b/notmuch-compact.c index 359acfc..1e7808c 100644 --- a/notmuch-compact.c +++ b/notm

[PATCH v2 11/11] man: document notmuch compact --verbose and --backup=DIRECTORY options

2013-11-03 Thread Jani Nikula
--- man/man1/notmuch-compact.1 | 28 +++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/man/man1/notmuch-compact.1 b/man/man1/notmuch-compact.1 index 1aeed22..dfffccb 100644 --- a/man/man1/notmuch-compact.1 +++ b/man/man1/notmuch-compact.1 @@ -4,6 +4,8 @@ no

[PATCH] test: fix compact backup / restore test

2013-11-03 Thread Jani Nikula
On Sat, 02 Nov 2013, David Bremner wrote: > It was looking in completely the wrong place for the backup and the > (test) xapian database. Unfortunately test_begin_subtest hides the > relevant errors. I included this, unchanged, in my series [1] that depends on it. It makes no difference which one

[PATCH 1/1] build: remove trailing '/.' when doing mkdir -p .deps/.

2013-11-03 Thread Tomi Ollila
When make variable $@ does not contain directory part, $(@D) resolves as '.'. In this case .deps/$(@D) is '.deps/.' In some systems `mkdir [-p] directory/.` fails. To make this compatible with more system substitute trailing '/.' (slashdot) with '' (empty string) whenever it occurs there. --- Make

[PATCH 1/1] build: remove trailing '/.' when doing mkdir -p .deps/.

2013-11-03 Thread Jed Brown
able Type: application/pgp-signature Size: 835 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20131103/6cd2f078/attachment.pgp>

Getting the right root mail of the thread

2013-11-03 Thread Daniel Kahn Gillmor
On 11/02/2013 09:08 AM, Felipe Contreras wrote: > Either way this doesn't make any sense to me. Each thread has a single origin > mail, why would anybody would like to show a message other than that while > displaying the summary of the tread? Even more, why isn't there an option to > fetch that in

Getting the right root mail of the thread

2013-11-03 Thread Felipe Contreras
On Sat, Nov 2, 2013 at 8:58 AM, Jani Nikula wrote: > On Sat, 02 Nov 2013, Felipe Contreras wrote: >> On Sat, Nov 2, 2013 at 7:50 AM, Jani Nikula wrote: >>> On Sat, 02 Nov 2013, Felipe Contreras wrote: >> I think there should be a way to get the root mail of a thread, irrespective of t

Getting the right root mail of the thread

2013-11-03 Thread Felipe Contreras
On Sun, Nov 3, 2013 at 1:22 PM, Daniel Kahn Gillmor wrote: > On 11/02/2013 09:08 AM, Felipe Contreras wrote: >> >> Either way this doesn't make any sense to me. Each thread has a single >> origin >> mail, why would anybody would like to show a message other than that while >> displaying the summar

Getting the right root mail of the thread

2013-11-03 Thread Jani Nikula
On Sun, 03 Nov 2013, Felipe Contreras wrote: > On Sat, Nov 2, 2013 at 8:58 AM, Jani Nikula wrote: >> On Sat, 02 Nov 2013, Felipe Contreras wrote: >>> On Sat, Nov 2, 2013 at 7:50 AM, Jani Nikula wrote: On Sat, 02 Nov 2013, Felipe Contreras wrote: >>> > I think there should be a w

Getting the right root mail of the thread

2013-11-03 Thread Jesse Rosenthal
Jani Nikula writes: > I think it's actually worse than what your example demonstrates. It's > the subject of the newest/oldest *matching* message that gets used. In > your example, the first/last messages in the thread apparently match > your query. The behavior is there because subjects frequent

Getting the right root mail of the thread

2013-11-03 Thread Jani Nikula
On Sun, 03 Nov 2013, Jesse Rosenthal wrote: > The current behavior can be annoying, but the old behavior could make > the MUA quite unusable in a number of circumstances. (And yes, an MUA > that fails on reading mail from senders with bad emailing practices is > unusable for me.) I wouldn't have

Getting the right root mail of the thread

2013-11-03 Thread Felipe Contreras
On Sun, Nov 3, 2013 at 2:35 PM, Jesse Rosenthal wrote: > Jani Nikula writes: >> I think it's actually worse than what your example demonstrates. It's >> the subject of the newest/oldest *matching* message that gets used. In >> your example, the first/last messages in the thread apparently match >

[PATCH 1/1] build: remove trailing '/.' when doing mkdir -p .deps/.

2013-11-03 Thread Tomi Ollila
On Sun, Nov 03 2013, Jed Brown wrote: > Tomi Ollila writes: > >> %.o: %.cc $(global_deps) >> -@mkdir -p .deps/$(@D) >> +@mkdir -p $(patsubst %/.,%,.deps/$(@D)) >> $(call quiet,CXX $(CPPFLAGS) $(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@ >> -MD -MP -MF .deps/$*.d > > An alternative a

[PATCH 8/8] emacs: Remove interactive behavior of `notmuch-tag'

2013-11-03 Thread Jameson Graef Rollins
On Tue, Oct 22 2013, Austin Clements wrote: > We no longer use this, since we've lifted all interactive behavior to > the appropriate interactive entry points. Because of this, > `notmuch-tag' also no longer needs to return the tag changes list, > since the caller always passes it in. > --- > em

[PATCH v2 01/11] test: fix compact backup / restore test

2013-11-03 Thread Jani Nikula
From: David Bremner It was looking in completely the wrong place for the backup and the (test) xapian database. Unfortunately test_begin_subtest hides the relevant errors. --- test/compact | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/compact b/test/compact inde

[PATCH v2 00/11] compactor changes v2

2013-11-03 Thread Jani Nikula
Hi all, this is v2 of [1], incorporating compact related patches from David, some changes from David's review, some new patches, man page update, test update. Cheers, Jani. [1] id:cover.1383315568.git.j...@nikula.org David Bremner (2): test: fix compact backup / restore test lib: update do

[PATCH v2 03/11] lib: check talloc success in compact

2013-11-03 Thread Jani Nikula
In line with the allocation checks all around. --- lib/database.cc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/database.cc b/lib/database.cc index 3dfea0f..7a8702e 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -863,13 +863,17 @@ notmuch_database_compact (co

[PATCH v2 02/11] lib: construct compactor within try block to catch any exceptions

2013-11-03 Thread Jani Nikula
Constructors may also throw exceptions. Catch them. --- lib/database.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/database.cc b/lib/database.cc index 20e5ec2..3dfea0f 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -864,7 +864,6 @@ notmuch_database_compact (co

[PATCH v2 04/11] lib: do not leak the database in compaction

2013-11-03 Thread Jani Nikula
Destroy instead of close the database after compaction, and also on error path, to not leak the database. --- lib/database.cc | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/database.cc b/lib/database.cc index 7a8702e..eadf8a7 100644 --- a/lib/database.cc +++ b/lib/da

[PATCH v2 05/11] lib: add closure parameter to compact status update callback

2013-11-03 Thread Jani Nikula
This provides much more flexibility for the caller. --- lib/database.cc | 14 +- lib/notmuch.h | 5 +++-- notmuch-compact.c | 8 +++- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/database.cc b/lib/database.cc index eadf8a7..5a01703 100644 --- a/lib/d

[PATCH v2 06/11] lib: update documentation of callback functions for database_compact and database_upgrade.

2013-11-03 Thread Jani Nikula
From: David Bremner Compact was missing callback documentation entirely, and upgrade did not discuss the closure parameter. --- lib/notmuch.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/notmuch.h b/lib/notmuch.h index cd301a4..82fd599 100644 --- a/lib/notmuch.h

[PATCH v2 10/11] cli: add compact --verbose option and silence output without it

2013-11-03 Thread Jani Nikula
If there's nothing surprising to say, don't say anything. Unless asked for by the user. --- notmuch-compact.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/notmuch-compact.c b/notmuch-compact.c index 359acfc..1e7808c 100644 --- a/notmuch-compact.c +++ b/notm

[PATCH v2 08/11] cli: return error status if compaction fails

2013-11-03 Thread Jani Nikula
As is customary for any tool. --- notmuch-compact.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/notmuch-compact.c b/notmuch-compact.c index 55dc731..b9461c2 100644 --- a/notmuch-compact.c +++ b/notmuch-compact.c @@ -43,16 +43,17 @@ notmuch_compact_comma

[PATCH v2 07/11] lib: use the compaction backup path provided by the caller

2013-11-03 Thread Jani Nikula
The extra path component added by the lib is a magic value that the caller just has to know. This is demonstrated by the current code, which indeed has "xapian.old" both sides of the interface. Use the backup path provided by the lib caller verbatim, without adding anything to it. --- v2: add xap

[PATCH v2 09/11] cli: add compact --backup=DIRECTORY option, don't backup by default

2013-11-03 Thread Jani Nikula
It's the user's decision. The recommended way is to do a database dump anyway. Clean up the relevant printfs too. --- v2: reorder prints --- notmuch-compact.c | 27 +-- test/compact | 4 ++-- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/notmuch-c

[PATCH v2 11/11] man: document notmuch compact --verbose and --backup=DIRECTORY options

2013-11-03 Thread Jani Nikula
--- man/man1/notmuch-compact.1 | 28 +++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/man/man1/notmuch-compact.1 b/man/man1/notmuch-compact.1 index 1aeed22..dfffccb 100644 --- a/man/man1/notmuch-compact.1 +++ b/man/man1/notmuch-compact.1 @@ -4,6 +4,8 @@ no

Re: [PATCH] test: fix compact backup / restore test

2013-11-03 Thread Jani Nikula
On Sat, 02 Nov 2013, David Bremner wrote: > It was looking in completely the wrong place for the backup and the > (test) xapian database. Unfortunately test_begin_subtest hides the > relevant errors. I included this, unchanged, in my series [1] that depends on it. It makes no difference which one

[PATCH 1/1] build: remove trailing '/.' when doing mkdir -p .deps/.

2013-11-03 Thread Tomi Ollila
When make variable $@ does not contain directory part, $(@D) resolves as '.'. In this case .deps/$(@D) is '.deps/.' In some systems `mkdir [-p] directory/.` fails. To make this compatible with more system substitute trailing '/.' (slashdot) with '' (empty string) whenever it occurs there. --- Make

Re: [PATCH 1/1] build: remove trailing '/.' when doing mkdir -p .deps/.

2013-11-03 Thread Jed Brown
Tomi Ollila writes: > %.o: %.cc $(global_deps) > - @mkdir -p .deps/$(@D) > + @mkdir -p $(patsubst %/.,%,.deps/$(@D)) > $(call quiet,CXX $(CPPFLAGS) $(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@ > -MD -MP -MF .deps/$*.d An alternative approach is to use directory marker files [1] to

Re: Getting the right root mail of the thread

2013-11-03 Thread Daniel Kahn Gillmor
On 11/02/2013 09:08 AM, Felipe Contreras wrote: Either way this doesn't make any sense to me. Each thread has a single origin mail, why would anybody would like to show a message other than that while displaying the summary of the tread? Even more, why isn't there an option to fetch that informat

Re: Getting the right root mail of the thread

2013-11-03 Thread Felipe Contreras
On Sat, Nov 2, 2013 at 8:58 AM, Jani Nikula wrote: > On Sat, 02 Nov 2013, Felipe Contreras wrote: >> On Sat, Nov 2, 2013 at 7:50 AM, Jani Nikula wrote: >>> On Sat, 02 Nov 2013, Felipe Contreras wrote: >> I think there should be a way to get the root mail of a thread, irrespective of t

Re: Getting the right root mail of the thread

2013-11-03 Thread Felipe Contreras
On Sun, Nov 3, 2013 at 1:22 PM, Daniel Kahn Gillmor wrote: > On 11/02/2013 09:08 AM, Felipe Contreras wrote: >> >> Either way this doesn't make any sense to me. Each thread has a single >> origin >> mail, why would anybody would like to show a message other than that while >> displaying the summar

Re: Getting the right root mail of the thread

2013-11-03 Thread Jani Nikula
On Sun, 03 Nov 2013, Felipe Contreras wrote: > On Sat, Nov 2, 2013 at 8:58 AM, Jani Nikula wrote: >> On Sat, 02 Nov 2013, Felipe Contreras wrote: >>> On Sat, Nov 2, 2013 at 7:50 AM, Jani Nikula wrote: On Sat, 02 Nov 2013, Felipe Contreras wrote: >>> > I think there should be a way to

Re: Getting the right root mail of the thread

2013-11-03 Thread Jesse Rosenthal
Jani Nikula writes: > I think it's actually worse than what your example demonstrates. It's > the subject of the newest/oldest *matching* message that gets used. In > your example, the first/last messages in the thread apparently match > your query. The behavior is there because subjects frequent

Re: Getting the right root mail of the thread

2013-11-03 Thread Jani Nikula
On Sun, 03 Nov 2013, Jesse Rosenthal wrote: > The current behavior can be annoying, but the old behavior could make > the MUA quite unusable in a number of circumstances. (And yes, an MUA > that fails on reading mail from senders with bad emailing practices is > unusable for me.) I wouldn't have

Re: Getting the right root mail of the thread

2013-11-03 Thread Felipe Contreras
On Sun, Nov 3, 2013 at 2:35 PM, Jesse Rosenthal wrote: > Jani Nikula writes: >> I think it's actually worse than what your example demonstrates. It's >> the subject of the newest/oldest *matching* message that gets used. In >> your example, the first/last messages in the thread apparently match >

Re: [PATCH 1/1] build: remove trailing '/.' when doing mkdir -p .deps/.

2013-11-03 Thread Tomi Ollila
On Sun, Nov 03 2013, Jed Brown wrote: > Tomi Ollila writes: > >> %.o: %.cc $(global_deps) >> -@mkdir -p .deps/$(@D) >> +@mkdir -p $(patsubst %/.,%,.deps/$(@D)) >> $(call quiet,CXX $(CPPFLAGS) $(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@ >> -MD -MP -MF .deps/$*.d > > An alternative a

Re: [PATCH 8/8] emacs: Remove interactive behavior of `notmuch-tag'

2013-11-03 Thread Jameson Graef Rollins
On Tue, Oct 22 2013, Austin Clements wrote: > We no longer use this, since we've lifted all interactive behavior to > the appropriate interactive entry points. Because of this, > `notmuch-tag' also no longer needs to return the tag changes list, > since the caller always passes it in. > --- > em