unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: david@tethera.net
To: notmuch@notmuchmail.org
Cc: Michal Sojka <sojka@os.inf.tu-dresden.de>
Subject: [PATCH] test: Adding non-maildir tags does not move message from new to cur
Date: Sat,  8 Dec 2012 15:15:32 -0400	[thread overview]
Message-ID: <1354994132-866-1-git-send-email-david@tethera.net> (raw)
In-Reply-To: <1316039001-32602-5-git-send-email-l.rilling@av7.net>

From: Michal Sojka <sojka@os.inf.tu-dresden.de>

Some MUA's like mutt show the difference between "new" emails living in maildir
directory new/, and "old" emails living in maildir directory cur/. However
notmuch tag unconditionally moves selected messages from new/ to cur/, even if
no maildir synchronized tag is changed.

While maildir specification forbids messages with tags living in new/, there is
no need to move messages to cur/ when no maildir synchronized tag is changed.
Thus notmuch can remain transparent with respect to other MUA's.

[ Edited commit log to better describe the intended changes, and tag the
  test as broken until the actual changes are implemented -- Louis Rilling ]

Signed-off-by: Louis Rilling <l.rilling@av7.net>

[ Converted to use test_subtest_known_broken, David Bremner ]
---

Do we agree that the behaviour of moving messages to ./cur on tagging
is broken? If so, maybe it's worth tidying up and applying this.  The
use of cd and ls strikes me as slightly suspect, but I welcome other
opinions.

 test/maildir-sync |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/test/maildir-sync b/test/maildir-sync
index 0fc742a..6165782 100755
--- a/test/maildir-sync
+++ b/test/maildir-sync
@@ -83,6 +83,15 @@ test_expect_equal "$output" "No new mail."
 # creating new directories in the mail store, then it should be
 # creating all necessary database state for those directories.
 
+test_begin_subtest "Adding non-maildir tags does not move message from new to cur"
+test_subtest_known_broken
+add_message [subject]='"Message to stay in new"' \
+    [date]='"Sat, 01 Jan 2000 12:00:00 -0000"' \
+    [filename]='message-to-stay-in-new' [dir]=new
+notmuch tag +donotmove subject:"Message to stay in new"
+output=$(cd "$MAIL_DIR"; ls */message-to-stay-in-new*)
+test_expect_equal "$output" "new/message-to-stay-in-new"
+
 test_begin_subtest "Removing 'S' flag from existing filename adds 'unread' tag"
 add_message [subject]='"Removing S flag"' [filename]='removing-s-flag:2,S' [dir]=cur
 output=$(notmuch search subject:"Removing S flag" | notmuch_search_sanitize)
-- 
1.7.10.4

  reply	other threads:[~2012-12-08 19:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-14 22:23 [PATCH 0/4 v4] lib: Maildir flags synchronization fixes Louis Rilling
2011-09-14 22:23 ` [PATCH 1/4] lib: Kill last usage of C++ type bool Louis Rilling
2011-09-14 22:23 ` [PATCH 2/4] tags_to_maildir_flags: Cleanup double assignement Louis Rilling
2011-11-22  0:41   ` David Bremner
2011-09-14 22:23 ` [PATCH 3/4] test: Adding non-maildir tags does not move message from new to cur Louis Rilling
2011-09-14 22:23 ` [PATCH 4/4] tags_to_maildir_flags: Don't rename if no flags change Louis Rilling
2012-12-08 19:15   ` david [this message]
2012-12-08 22:14     ` [PATCH] test: Adding non-maildir tags does not move message from new to cur Jani Nikula
2012-12-19 21:39       ` Michal Sojka
2012-11-06  0:16 ` [PATCH 0/4 v4] lib: Maildir flags synchronization fixes Daniel
2012-11-06  2:16   ` David Bremner
2012-11-06 13:35     ` Daniel
  -- strict thread matches above, loose matches on Subject: below --
2011-07-12 13:59 [PATCH 3/3] tags_to_maildir_flags: Don't rename if no flags change Louis Rilling
2011-07-14  0:06 ` [PATCH] test: Adding non-maildir tags does not move message from new to cur Michal Sojka
2011-07-14 14:11   ` Louis Rilling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354994132-866-1-git-send-email-david@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    --cc=sojka@os.inf.tu-dresden.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).