From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 519FF431FAF for ; Sat, 8 Dec 2012 14:14:20 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lIvwBY0jOfrY for ; Sat, 8 Dec 2012 14:14:19 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 5AFFA431FAE for ; Sat, 8 Dec 2012 14:14:19 -0800 (PST) Received: by mail-lb0-f181.google.com with SMTP id ge1so1292017lbb.26 for ; Sat, 08 Dec 2012 14:14:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:x-gm-message-state; bh=xtr0k5xT7dzVC0gyUqvbFJS2p0J5d+g3iUJUitbtx3g=; b=evlaUMGQ647EiFreEJn/ezxN8MYPy/vgOfFB5QTrA7YoyvyOoykBA/pVzKBMWzltjc +F8S9x3W+fOa/ElWFAhozSKzed2VNH25lAAwVOECoo2xzJTmjLT9Hc5ea/XH9Erpuytj QIbF+Sd2X+GSBuCzs7IGyMqgWTEHO/gwl4oecL7mvpQOUBZe2s6oiAEgR4Ou7iu7nv/q fddF01jQH1lPQQsfBcKvB3iuDXPCNZyBggRO0ebav3UI3suEzPYTI+WlXJxXAb7bkf71 ZZUmJ9zK2W554ilnugVdOAk9SWzdOCz9ed05r3Wdc1Ed/CClA99vp7nuh4YmvfQfzjp+ qZWw== Received: by 10.152.110.18 with SMTP id hw18mr35004lab.22.1355004856499; Sat, 08 Dec 2012 14:14:16 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi. [80.223.81.27]) by mx.google.com with ESMTPS id s9sm2392215lbc.12.2012.12.08.14.14.14 (version=SSLv3 cipher=OTHER); Sat, 08 Dec 2012 14:14:15 -0800 (PST) From: Jani Nikula To: david@tethera.net, notmuch@notmuchmail.org Subject: Re: [PATCH] test: Adding non-maildir tags does not move message from new to cur In-Reply-To: <1354994132-866-1-git-send-email-david@tethera.net> References: <1316039001-32602-5-git-send-email-l.rilling@av7.net> <1354994132-866-1-git-send-email-david@tethera.net> User-Agent: Notmuch/0.14+138~g7041c56 (http://notmuchmail.org) Emacs/23.4.1 (i686-pc-linux-gnu) Date: Sun, 09 Dec 2012 00:14:12 +0200 Message-ID: <87vcccp4y3.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gm-Message-State: ALoCoQncgJ6bgfhSeZDLfJTz/lm7Xs/Lx9odzK+y1Hn8qDQralGHI8xOVwUoFKqasozctAWeY6Ku Cc: Michal Sojka X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Dec 2012 22:14:20 -0000 On Sat, 08 Dec 2012, david@tethera.net wrote: > From: Michal Sojka > > 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 > > [ 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. I think I would narrow down the special case a bit: I think messages in ./new that have no maildir flags, and have no ":2," in the end of the filename, and and the tag change(s) will not affect maildir flags, should stay in ./new. Files in ./new should not have ":2," or maildir flags, and I see no reason to support having them there. Thus any messages in ./new that do have maildir flags, or have ":2," in the end of the filename should probably be moved to ./cur, even if the tag change(s) do not affect maildir flags. The patch in this thread fails here. It also changes the behaviour for messages in ./cur by not appending ":2," to them. As to the test, I think it should do something along the lines of (based on search-output test): notmuch search --output=files subject:"Message to stay in new" | sed -e "s,$MAIL_DIR,MAIL_DIR," >OUTPUT cat <EXPECTED MAIL_DIR/new/message-to-stay-in-new EOF test_expect_equal_file OUTPUT EXPECTED And would be nice to have similar tests for the other things I mentioned above. If people agree with narrowing down the special case as I suggest, that is. BR, Jani. > > 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 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch