[PATCH 1/1] test/test-lib.sh: use $test_subtest_name in all tests

2013-01-20 Thread Tomi Ollila
Set the variable '$test_subtest_name' in all functions which starts a new test and use that variable in all functions that output test results. Additionally output the latest '$test_subtest_name' in case of abnormal exit, to avoid confusion. --- The main reason to do this change is to get latest

[PATCH 1/1] NEWS: correction to section 0.15 for markdown processing

2013-01-20 Thread Tomi Ollila
At the end of section 0.15 the strings TEST_EMACS TEST_EMACSCLIENT are now put inside ``:s for better output after markdown processing. --- NEWS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 1cb52dd..9d6bd19 100644 --- a/NEWS +++ b/NEWS @@ -182,8

Re: [PATCH 5/7] CLI: add --leak-report top level option

2013-01-20 Thread Jameson Graef Rollins
On Sat, Jan 19 2013, da...@tethera.net wrote: This roughly mimics the samba4 argument. The presence of the command line argument overrides any value of NOTMUCH_TALLOC_REPORT in the environment. --- man/man1/notmuch.1 |8 notmuch.c | 18 +++--- 2 files

Re: [PATCH 5/7] CLI: add --leak-report top level option

2013-01-20 Thread Tomi Ollila
On Sun, Jan 20 2013, Jameson Graef Rollins jroll...@finestructure.net wrote: On Sat, Jan 19 2013, da...@tethera.net wrote: This roughly mimics the samba4 argument. The presence of the command line argument overrides any value of NOTMUCH_TALLOC_REPORT in the environment. ---

[PATCH 2/2] test/test-lib.sh: separate signaled exit

2013-01-20 Thread Tomi Ollila
When execution of tests is interrupted by signal coming outside of the test system itself, output just one line interrupted by signal num message to standard output. This distinguishes the case from internal exit and reduces noise. --- test/test-lib.sh | 15 ++- 1 file changed, 14

[PATCH 1/2] test/test-lib.sh: use $test_subtest_name in all tests

2013-01-20 Thread Tomi Ollila
Set the variable '$test_subtest_name' in all functions which starts a new test and use that variable in all functions that output test results. Additionally output the latest '$test_subtest_name' in case of abnormal exit, to avoid confusion. --- This obsoletes

[PATCH v3 00/20] insert command

2013-01-20 Thread Peter Wang
This mainly addresses review comments from v2 and rebases on top of tag-util.c. Peter Wang (20): cli: add stub for insert command insert: open Maildir tmp file insert: copy stdin to Maildir tmp file insert: move file from Maildir tmp to new insert: add new message to database insert:

[PATCH v3 02/20] insert: open Maildir tmp file

2013-01-20 Thread Peter Wang
Open a unique file in the Maildir tmp directory. The new message is not yet copied into the file. --- notmuch-insert.c | 105 ++- 1 file changed, 104 insertions(+), 1 deletion(-) diff --git a/notmuch-insert.c b/notmuch-insert.c index

[PATCH v3 03/20] insert: copy stdin to Maildir tmp file

2013-01-20 Thread Peter Wang
Read the new message from standard input into the Maildir tmp file. --- notmuch-insert.c | 51 +++ 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/notmuch-insert.c b/notmuch-insert.c index 7d100ae..38e815f 100644 ---

[PATCH v3 04/20] insert: move file from Maildir tmp to new

2013-01-20 Thread Peter Wang
Atomically move the new message file from the Maildir 'tmp' directory to 'new'. --- notmuch-insert.c | 21 + 1 file changed, 21 insertions(+) diff --git a/notmuch-insert.c b/notmuch-insert.c index 38e815f..c0289d9 100644 --- a/notmuch-insert.c +++ b/notmuch-insert.c @@ -94,6

[PATCH v3 05/20] insert: add new message to database

2013-01-20 Thread Peter Wang
Add the new message to the notmuch database, renaming the file to encode notmuch tags as maildir flags. --- notmuch-insert.c | 49 - 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/notmuch-insert.c b/notmuch-insert.c index

[PATCH v3 06/20] insert: apply default tags to new message

2013-01-20 Thread Peter Wang
Apply the new.tags to messages added by 'insert'. This mirrors the behaviour if the message were delivered by a separate tool followed by 'notmuch new'. --- notmuch-insert.c | 29 +++-- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/notmuch-insert.c

[PATCH v3 07/20] tag-util: do not reset list in parse_tag_command_line

2013-01-20 Thread Peter Wang
No current callers of parse_tag_command_line require that it clear its tag list argument. The notmuch 'insert' command will be better served if the function modifies a pre-populated list (of new.tags) instead of clobbering it outright. --- tag-util.c | 2 -- tag-util.h | 2 ++ 2 files changed, 2

[PATCH v3 08/20] tag-util: move out 'tag' command-line checks

2013-01-20 Thread Peter Wang
parse_tag_command_line checked for two error conditions which are specific to the 'tag' command. It can be reused for the notmuch 'insert' command if we move the checks out, into notmuch-tag.c. --- notmuch-tag.c | 10 ++ tag-util.c| 10 -- 2 files changed, 10 insertions(+),

[PATCH v3 09/20] insert: parse and apply command-line tag operations

2013-01-20 Thread Peter Wang
Parse +tag and -tag operations on the 'insert' command-line and apply them to the inserted message in addition to new.tags. --- notmuch-insert.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/notmuch-insert.c b/notmuch-insert.c index 8388d07..b0ac174 100644 ---

[PATCH v3 10/20] insert: support --folder option

2013-01-20 Thread Peter Wang
Allow the new message to be inserted into a folder within the Maildir hierarchy instead of the top-level folder. --- notmuch-insert.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/notmuch-insert.c b/notmuch-insert.c index b0ac174..ba8cf5a 100644 ---

[PATCH v3 11/20] insert: prevent writes outside Maildir hierarchy

2013-01-20 Thread Peter Wang
Don't accept a --folder name that contains a ".." component, in order to prevent writing outside of the Maildir hierarchy. --- notmuch-insert.c | 21 + 1 file changed, 21 insertions(+) diff --git a/notmuch-insert.c b/notmuch-insert.c index ba8cf5a..67ef94a 100644 ---

[PATCH v3 12/20] insert: add --create-folder option

2013-01-20 Thread Peter Wang
Support an option to create a new folder in the maildir. --- notmuch-insert.c | 88 1 file changed, 88 insertions(+) diff --git a/notmuch-insert.c b/notmuch-insert.c index 67ef94a..85acaea 100644 --- a/notmuch-insert.c +++

[PATCH v3 13/20] insert: fsync after writing tmp file

2013-01-20 Thread Peter Wang
Flush the tmp file to disk after writing for durability. --- notmuch-insert.c | 4 1 file changed, 4 insertions(+) diff --git a/notmuch-insert.c b/notmuch-insert.c index 85acaea..60855c1 100644 --- a/notmuch-insert.c +++ b/notmuch-insert.c @@ -305,6 +305,10 @@ insert_message (void *ctx,

[PATCH v3 14/20] insert: fsync new directory after rename

2013-01-20 Thread Peter Wang
After moving the file from the 'tmp' to the 'new' directory, fsync on the 'new' directory for durability. --- notmuch-insert.c | 41 ++--- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/notmuch-insert.c b/notmuch-insert.c index 60855c1..c4d5e75

[PATCH v3 15/20] insert: fsync parent directory after mkdir

2013-01-20 Thread Peter Wang
After creating a subdirectory, fsync on its parent directory for durability. --- notmuch-insert.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/notmuch-insert.c b/notmuch-insert.c index c4d5e75..8012eb4 100644 --- a/notmuch-insert.c +++ b/notmuch-insert.c @@

[PATCH v3 16/20] insert: trap SIGINT and clean up

2013-01-20 Thread Peter Wang
The only potentially long-running part of the 'insert' command should be copying stdin to the 'tmp' file. If SIGINT is received during the copying process, abort and clean up the file in 'tmp'. At all other points, just ignore the signal and continue. --- notmuch-insert.c | 28

[PATCH v3 17/20] insert: add copyright line from notmuch-deliver

2013-01-20 Thread Peter Wang
The 'insert' implementation was based partly on notmuch-deliver. --- notmuch-insert.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/notmuch-insert.c b/notmuch-insert.c index 494a7b0..6b3e380 100644 --- a/notmuch-insert.c +++ b/notmuch-insert.c @@ -2,6 +2,9 @@ * * Copyright ? 2013

[PATCH v3 18/20] man: document 'insert' command

2013-01-20 Thread Peter Wang
Add initial documentation for notmuch insert command. --- man/Makefile.local| 1 + man/man1/notmuch-insert.1 | 59 +++ 2 files changed, 60 insertions(+) create mode 100644 man/man1/notmuch-insert.1 diff --git a/man/Makefile.local

[PATCH v3 20/20] test: add tests for insert

2013-01-20 Thread Peter Wang
Add tests for new 'insert' command. --- test/insert | 106 ++ test/notmuch-test | 1 + 2 files changed, 107 insertions(+) create mode 100755 test/insert diff --git a/test/insert b/test/insert new file mode 100755 index 000..a3b6283

[PATCH v3 19/20] man: reference notmuch-insert.1

2013-01-20 Thread Peter Wang
Add references to notmuch-insert.1 from other man pages. --- man/man1/notmuch-config.1 | 4 ++-- man/man1/notmuch-count.1| 4 ++-- man/man1/notmuch-dump.1 | 4 ++-- man/man1/notmuch-new.1 | 4 ++-- man/man1/notmuch-reply.1| 3 ++- man/man1/notmuch-restore.1

[PATCH 1/1] test/test-lib.sh: use $test_subtest_name in all tests

2013-01-20 Thread Tomi Ollila
Set the variable '$test_subtest_name' in all functions which starts a new test and use that variable in all functions that output test results. Additionally output the latest '$test_subtest_name' in case of abnormal exit, to avoid confusion. --- The main reason to do this change is to get latest

[PATCH 1/1] NEWS: correction to section 0.15 for markdown processing

2013-01-20 Thread Tomi Ollila
At the end of section 0.15 the strings TEST_EMACS & TEST_EMACSCLIENT are now put inside ``:s for better output after markdown processing. --- NEWS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 1cb52dd..9d6bd19 100644 --- a/NEWS +++ b/NEWS @@ -182,8

[PATCH 5/7] CLI: add --leak-report top level option

2013-01-20 Thread Jameson Graef Rollins
ure Size: 835 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20130120/aeb8119f/attachment.pgp>