unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* BUG: notmuch dump --include=properties implies --include=tags
@ 2017-05-07 14:21 David Bremner
  2017-05-08  1:44 ` [PATCH 1/2] test: add known broken test --include=properties David Bremner
  0 siblings, 1 reply; 4+ messages in thread
From: David Bremner @ 2017-05-07 14:21 UTC (permalink / raw)
  To: notmuch, notmuch


This is almost certainly my fault, but

% notmuch dump --include=properties '*'

also includes the (typically much more voluminous) tag information.

I looks like the call to dump_tags_message on line 253 needs to be
guarded by (include & DUMP_INCLUDE_TAGS).

I'm not sure how serious a bug this is, e.g. if it's worth fixing for
debian stretch.

d

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] test: add known broken test --include=properties
  2017-05-07 14:21 BUG: notmuch dump --include=properties implies --include=tags David Bremner
@ 2017-05-08  1:44 ` David Bremner
  2017-05-08  1:44   ` [PATCH 2/2] cli/dump: don't include tags when not asked for David Bremner
  0 siblings, 1 reply; 4+ messages in thread
From: David Bremner @ 2017-05-08  1:44 UTC (permalink / raw)
  To: David Bremner, notmuch, notmuch

Reported in [1], --include=properties currently implies
--include=tags, but it should not.

[1] id:87y3u8vjbo.fsf@tethera.net
---
 test/T610-message-property.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh
index 65ff19dc..7d95bde6 100755
--- a/test/T610-message-property.sh
+++ b/test/T610-message-property.sh
@@ -209,6 +209,15 @@ EOF
 notmuch dump | grep '^#=' > OUTPUT
 test_expect_equal_file PROPERTIES OUTPUT
 
+test_begin_subtest "dump _only_ message properties"
+test_subtest_known_broken
+cat <<EOF > EXPECTED
+#notmuch-dump batch-tag:3 properties
+#= 4EFC743A.3060609@april.org fancy%20key%20with%20%c3%a1cc%c3%a8nts=import%20value%20with%20= testkey1=alice testkey1=bob testkey1=testvalue1 testkey1=testvalue2 testkey3=alice3 testkey3=bob3 testkey3=testvalue3
+EOF
+notmuch dump --include=properties > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
 
 test_begin_subtest "restore missing message property (single line)"
 notmuch dump | grep '^#=' > BEFORE1
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] cli/dump: don't include tags when not asked for
  2017-05-08  1:44 ` [PATCH 1/2] test: add known broken test --include=properties David Bremner
@ 2017-05-08  1:44   ` David Bremner
  2017-05-23 11:11     ` David Bremner
  0 siblings, 1 reply; 4+ messages in thread
From: David Bremner @ 2017-05-08  1:44 UTC (permalink / raw)
  To: David Bremner, notmuch, notmuch

Add in the analogous test for tags that is given for properties a few
lines below.
---
 notmuch-dump.c                | 3 ++-
 test/T610-message-property.sh | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/notmuch-dump.c b/notmuch-dump.c
index e451ac0c..5cc3b2f6 100644
--- a/notmuch-dump.c
+++ b/notmuch-dump.c
@@ -250,7 +250,8 @@ database_dump_file (notmuch_database_t *notmuch, gzFile output,
 
 	message = notmuch_messages_get (messages);
 
-	if (dump_tags_message (notmuch, message, output_format, output,
+	if ((include & DUMP_INCLUDE_TAGS) &&
+	    dump_tags_message (notmuch, message, output_format, output,
 			       &buffer, &buffer_size))
 	    return EXIT_FAILURE;
 
diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh
index 7d95bde6..ba5f55da 100755
--- a/test/T610-message-property.sh
+++ b/test/T610-message-property.sh
@@ -210,7 +210,6 @@ notmuch dump | grep '^#=' > OUTPUT
 test_expect_equal_file PROPERTIES OUTPUT
 
 test_begin_subtest "dump _only_ message properties"
-test_subtest_known_broken
 cat <<EOF > EXPECTED
 #notmuch-dump batch-tag:3 properties
 #= 4EFC743A.3060609@april.org fancy%20key%20with%20%c3%a1cc%c3%a8nts=import%20value%20with%20= testkey1=alice testkey1=bob testkey1=testvalue1 testkey1=testvalue2 testkey3=alice3 testkey3=bob3 testkey3=testvalue3
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] cli/dump: don't include tags when not asked for
  2017-05-08  1:44   ` [PATCH 2/2] cli/dump: don't include tags when not asked for David Bremner
@ 2017-05-23 11:11     ` David Bremner
  0 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2017-05-23 11:11 UTC (permalink / raw)
  To: notmuch, notmuch

David Bremner <david@tethera.net> writes:

> Add in the analogous test for tags that is given for properties a few
> lines below.
> ---
>  notmuch-dump.c                | 3 ++-
>  test/T610-message-property.sh | 1 -
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/notmuch-dump.c b/notmuch-dump.c
> index e451ac0c..5cc3b2f6 100644
> --- a/notmuch-dump.c
> +++ b/notmuch-dump.c
> @@ -250,7 +250,8 @@ database_dump_file (notmuch_database_t *notmuch, gzFile output,
>  
>  	message = notmuch_messages_get (messages);
>  
> -	if (dump_tags_message (notmuch, message, output_format, output,
> +	if ((include & DUMP_INCLUDE_TAGS) &&
> +	    dump_tags_message (notmuch, message, output_format, output,
>  			       &buffer, &buffer_size))
>  	    return EXIT_FAILURE;

I'd like to include this two line patch in 0.24.2, along with Mark's fix
2d79d38a0. Any objections? Any other similar fixes that should be
included in 0.24.2?

d

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-23 11:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-07 14:21 BUG: notmuch dump --include=properties implies --include=tags David Bremner
2017-05-08  1:44 ` [PATCH 1/2] test: add known broken test --include=properties David Bremner
2017-05-08  1:44   ` [PATCH 2/2] cli/dump: don't include tags when not asked for David Bremner
2017-05-23 11:11     ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).