[PATCH] devel: add release-checks.sh

2012-08-08 Thread Tomi Ollila
Currently Makefile.local contains some machine executable release checking functionality. This is unnecessarily complex way to do it: Multiline script functionality is hard to embed -- from Makefile point of view there is just one line split using backslashes and every line ends with ';'. It is ha

[PATCH 1/4] show: indicate length of omitted body content (json)

2012-08-08 Thread Peter Wang
On Wed, 08 Aug 2012 00:01:06 +0100, Mark Walters wrote: > > I have two minor queries: do you think omitted text/html parts should > also have the length given? Or even should it always be sent? But I am > happy with it as is. It could be added. I wouldn't have much use for it myself. text/html

[PATCH v2 3/3] test: conform to content length, encoding fields

2012-08-08 Thread Peter Wang
Update tests to expect content-length and content-transfer-encoding fields in show --format=json output, for leaf parts with omitted body content. --- test/crypto| 30 +- test/json |2 +- test/multipart |9 + 3 files changed, 27 insertions(+),

[PATCH v2 2/3] show: indicate length, encoding of omitted body content

2012-08-08 Thread Peter Wang
If a leaf part's body content is omitted, return the encoded length and transfer encoding in --format=json output. This information may be used by the consumer, e.g. to decide whether to download a large attachment over a slow link. Returning the _encoded_ content length is more efficient than re

[PATCH v2 1/3] test: normalize only message filenames in show json

2012-08-08 Thread Peter Wang
notmuch_json_show_sanitize replaced "filename" field values even in part structures, where the value is predictable. Make it only normalize the filename value if it is an absolute path (begins with slash), which is true of the Maildir filenames that were intended to be normalized away. --- test/m

[PATCH v2 0/3] indicate length of omitted body content

2012-08-08 Thread Peter Wang
The first commit is tangentally related. An expected test case output in test/crypto previously had a filename left unnormalised by notmuch_json_show_sanitize because it was not followed by comma. The next commit causes the comma to be present, breaking the expected output. In the 2nd commit, a c

[PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-08 Thread Mark Walters
The string function in a sprinter may be called with a NULL string pointer (eg if a header is absent). This causes a segfault. We fix this by checking for a null pointer in the string functions and update the sprinter documentation. At the moment some output when format=text is done directly rath

[PATCH v2] test: Add test for messages with missing headers

2012-08-08 Thread Tomi Ollila
On Wed, Aug 08 2012, Austin Clements wrote: > Quoth Tomi Ollila on Aug 08 at 11:08 am: >> On Wed, Aug 08 2012, Austin Clements wrote: >> >> > Currently the JSON tests for search and show are broken because >> > notmuch attempts to dereference a NULL pointer. >> > --- >> > This version fixes the

[PATCH] emacs: Fix "not defined at runtime" warning

2012-08-08 Thread Austin Clements
Previously, the Emacs byte compiler produced the warning the function `remove-if-not' might not be defined at runtime. because we only required cl at compile-time (not runtime). This fixes this warning by requiring cl at runtime, ensuring that the definition of remove-if-not is available. --

[PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-08 Thread Austin Clements
LGTM! Quoth Mark Walters on Aug 08 at 10:23 pm: > > The string function in a sprinter may be called with a NULL string > pointer (eg if a header is absent). This causes a segfault. We fix > this by checking for a null pointer in the string functions and update > the sprinter documentation. > > A

[PATCH v2] test: Add test for messages with missing headers

2012-08-08 Thread Austin Clements
Quoth Tomi Ollila on Aug 08 at 9:47 pm: > On Wed, Aug 08 2012, Austin Clements wrote: > > Not another JSON parser/printer! > > Why not, one from scratch, without looking any source there is already >;) > > Well, you're right; the json.tool version python 2.6 provides is good -- > -- ordering an

[PATCH] emacs: Fix "not defined at runtime" warning

2012-08-08 Thread Austin Clements
Previously, the Emacs byte compiler produced the warning the function `remove-if-not' might not be defined at runtime. because we only required cl at compile-time (not runtime). This fixes this warning by requiring cl at runtime, ensuring that the definition of remove-if-not is available. --

Re: [PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-08 Thread Austin Clements
LGTM! Quoth Mark Walters on Aug 08 at 10:23 pm: > > The string function in a sprinter may be called with a NULL string > pointer (eg if a header is absent). This causes a segfault. We fix > this by checking for a null pointer in the string functions and update > the sprinter documentation. > > A

[PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-08 Thread Mark Walters
The string function in a sprinter may be called with a NULL string pointer (eg if a header is absent). This causes a segfault. We fix this by checking for a null pointer in the string functions and update the sprinter documentation. At the moment some output when format=text is done directly rath

[PATCH] devel: add release-checks.sh

2012-08-08 Thread Tomi Ollila
Currently Makefile.local contains some machine executable release checking functionality. This is unnecessarily complex way to do it: Multiline script functionality is hard to embed -- from Makefile point of view there is just one line split using backslashes and every line ends with ';'. It is ha

Re: [PATCH v2] test: Add test for messages with missing headers

2012-08-08 Thread Austin Clements
Quoth Tomi Ollila on Aug 08 at 9:47 pm: > On Wed, Aug 08 2012, Austin Clements wrote: > > Not another JSON parser/printer! > > Why not, one from scratch, without looking any source there is already >;) > > Well, you're right; the json.tool version python 2.6 provides is good -- > -- ordering an

Re: [PATCH v2] test: Add test for messages with missing headers

2012-08-08 Thread Tomi Ollila
On Wed, Aug 08 2012, Austin Clements wrote: > Quoth Tomi Ollila on Aug 08 at 11:08 am: >> On Wed, Aug 08 2012, Austin Clements wrote: >> >> > Currently the JSON tests for search and show are broken because >> > notmuch attempts to dereference a NULL pointer. >> > --- >> > This version fixes the

[PATCH v2] test: Add test for messages with missing headers

2012-08-08 Thread Austin Clements
Quoth Tomi Ollila on Aug 08 at 11:08 am: > On Wed, Aug 08 2012, Austin Clements wrote: > > > Currently the JSON tests for search and show are broken because > > notmuch attempts to dereference a NULL pointer. > > --- > > This version fixes the "Show: text" test so that it sanitize its > > output

[PATCH v2] test: Add test for messages with missing headers

2012-08-08 Thread Tomi Ollila
On Wed, Aug 08 2012, Austin Clements wrote: > Currently the JSON tests for search and show are broken because > notmuch attempts to dereference a NULL pointer. > --- > This version fixes the "Show: text" test so that it sanitize its > output and doesn't hard-code my test paths. +1 Tomi w/ pyth

Re: [PATCH 3/3] test: add broken roundtrip test

2012-08-08 Thread Jameson Graef Rollins
On Wed, Aug 08 2012, Mark Walters wrote: >> test/dump-restore |9 + >> 1 file changed, 9 insertions(+) >> >> diff --git a/test/dump-restore b/test/dump-restore >> index 439e998..7979ebf 100755 >> --- a/test/dump-restore >> +++ b/test/dump-restore >> @@ -82,4 +82,13 @@ test_begin_subte

[PATCH 3/3] test: add broken roundtrip test

2012-08-08 Thread Jameson Graef Rollins
ther. This seems like a strange way to run these tests, as a command string to test_expect_success. Why not just run them directly? I'm also worried about the test output blowing away the users terminal. I think that should be avoided, even if we expect failures to be rare. jamie. -

Re: [PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-08 Thread Jameson Graef Rollins
On Wed, Aug 08 2012, Mark Walters wrote: > For the From/Date headers see http://www.ietf.org/rfc/rfc2822.txt > section 3.6 for details: > >The only required header fields are the origination date field and >the originator address field(s). All other header fields are >syntactically op

[PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-08 Thread Jameson Graef Rollins
non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120808/b504e295/attachment.pgp>

[PATCH 3/3] test: add broken roundtrip test

2012-08-08 Thread Mark Walters
On Sun, 05 Aug 2012, david at tethera.net wrote: > From: David Bremner > > The output of test_cmp is redirected because it is pretty horrible, > and tends to mess up terminals. When the test is no longer marked as > broken, this redirection should be removed. How about piping the output to hexdum

[PATCH v2] emacs: notmuch search bugfix

2012-08-08 Thread Tomi Ollila
On Tue, Aug 07 2012, Mark Walters wrote: > The recent change to use json for notmuch-search.el introduced a bug > in the code for keeping position on refresh. The problem is a > comparison between (plist-get result :thread) and a thread-id returned > by notmuch-search-find-thread-id: the latter i

Re: [PATCH v2] test: Add test for messages with missing headers

2012-08-08 Thread Austin Clements
Quoth Tomi Ollila on Aug 08 at 11:08 am: > On Wed, Aug 08 2012, Austin Clements wrote: > > > Currently the JSON tests for search and show are broken because > > notmuch attempts to dereference a NULL pointer. > > --- > > This version fixes the "Show: text" test so that it sanitize its > > output

[PATCH 2/3] test: add generator for random "stub" messages

2012-08-08 Thread Mark Walters
Hi I don't think I know enough Xapian to sensibly review the first patch in this series. On Sun, 05 Aug 2012, david at tethera.net wrote: > From: David Bremner > > Initial use case is testing dump and restore, so we only have > message-ids and tags. > > The message ID's are nothing like RFC comp

[PATCH v2] test: Add test for messages with missing headers

2012-08-08 Thread Mark Walters
On Wed, 08 Aug 2012, Austin Clements wrote: > Currently the JSON tests for search and show are broken because > notmuch attempts to dereference a NULL pointer. > --- > This version fixes the "Show: text" test so that it sanitize its > output and doesn't hard-code my test paths. LGTM +1. Tests wo

[PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-08 Thread Mark Walters
On Wed, 08 Aug 2012, Austin Clements wrote: > LGTM. > > This won't commute with [0], since that introduces broken tests that are > fixed by this patch. Yes: I guess the tidiest might be for me to send a version of my patch which marks these tests fixed so it can be applied after this. > I think

Re: [PATCH 1/4] show: indicate length of omitted body content (json)

2012-08-08 Thread Peter Wang
On Wed, 08 Aug 2012 00:01:06 +0100, Mark Walters wrote: > > I have two minor queries: do you think omitted text/html parts should > also have the length given? Or even should it always be sent? But I am > happy with it as is. It could be added. I wouldn't have much use for it myself. text/html

[PATCH v2 3/3] test: conform to content length, encoding fields

2012-08-08 Thread Peter Wang
Update tests to expect content-length and content-transfer-encoding fields in show --format=json output, for leaf parts with omitted body content. --- test/crypto| 30 +- test/json |2 +- test/multipart |9 + 3 files changed, 27 insertions(+),

[PATCH v2 2/3] show: indicate length, encoding of omitted body content

2012-08-08 Thread Peter Wang
If a leaf part's body content is omitted, return the encoded length and transfer encoding in --format=json output. This information may be used by the consumer, e.g. to decide whether to download a large attachment over a slow link. Returning the _encoded_ content length is more efficient than re

[PATCH v2 1/3] test: normalize only message filenames in show json

2012-08-08 Thread Peter Wang
notmuch_json_show_sanitize replaced "filename" field values even in part structures, where the value is predictable. Make it only normalize the filename value if it is an absolute path (begins with slash), which is true of the Maildir filenames that were intended to be normalized away. --- test/m

[PATCH v2 0/3] indicate length of omitted body content

2012-08-08 Thread Peter Wang
The first commit is tangentally related. An expected test case output in test/crypto previously had a filename left unnormalised by notmuch_json_show_sanitize because it was not followed by comma. The next commit causes the comma to be present, breaking the expected output. In the 2nd commit, a c

Re: [PATCH v2] test: Add test for messages with missing headers

2012-08-08 Thread Tomi Ollila
On Wed, Aug 08 2012, Austin Clements wrote: > Currently the JSON tests for search and show are broken because > notmuch attempts to dereference a NULL pointer. > --- > This version fixes the "Show: text" test so that it sanitize its > output and doesn't hard-code my test paths. +1 Tomi w/ pyth

Re: [PATCH 3/3] test: add broken roundtrip test

2012-08-08 Thread Mark Walters
On Sun, 05 Aug 2012, da...@tethera.net wrote: > From: David Bremner > > The output of test_cmp is redirected because it is pretty horrible, > and tends to mess up terminals. When the test is no longer marked as > broken, this redirection should be removed. How about piping the output to hexdump o

Re: [PATCH 2/3] test: add generator for random "stub" messages

2012-08-08 Thread Mark Walters
Hi I don't think I know enough Xapian to sensibly review the first patch in this series. On Sun, 05 Aug 2012, da...@tethera.net wrote: > From: David Bremner > > Initial use case is testing dump and restore, so we only have > message-ids and tags. > > The message ID's are nothing like RFC complia

Re: [PATCH v2] test: Add test for messages with missing headers

2012-08-08 Thread Mark Walters
On Wed, 08 Aug 2012, Austin Clements wrote: > Currently the JSON tests for search and show are broken because > notmuch attempts to dereference a NULL pointer. > --- > This version fixes the "Show: text" test so that it sanitize its > output and doesn't hard-code my test paths. LGTM +1. Tests wo

Re: [PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-08 Thread Mark Walters
On Wed, 08 Aug 2012, Austin Clements wrote: > LGTM. > > This won't commute with [0], since that introduces broken tests that are > fixed by this patch. Yes: I guess the tidiest might be for me to send a version of my patch which marks these tests fixed so it can be applied after this. > I think

[PATCH 1/4] show: indicate length of omitted body content (json)

2012-08-08 Thread Mark Walters
I like this (and agree with Austin and you that text and json can diverge). I just hacked something together which uses this and makes the emacs front-end display the content-length on part buttons and as someone who uses notmuch over ssh that is nice. I have two minor queries: do you think omitt