Re: [PATCH] test: Adding non-maildir tags does not move message from new to cur
authorMichal Sojka <sojka@os.inf.tu-dresden.de>
Wed, 19 Dec 2012 21:39:17 +0000 (22:39 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:52:33 +0000 (09:52 -0800)
cf/2a7f4dd9abd4406e7e7296d6a29f3081234607 [new file with mode: 0644]

diff --git a/cf/2a7f4dd9abd4406e7e7296d6a29f3081234607 b/cf/2a7f4dd9abd4406e7e7296d6a29f3081234607
new file mode 100644 (file)
index 0000000..27bfcac
--- /dev/null
@@ -0,0 +1,125 @@
+Return-Path: <sojkam1@fel.cvut.cz>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id BFC4F431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 19 Dec 2012 13:39:27 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 5rJoA43xMx9h for <notmuch@notmuchmail.org>;\r
+       Wed, 19 Dec 2012 13:39:25 -0800 (PST)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id 70901431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 19 Dec 2012 13:39:25 -0800 (PST)\r
+Received: from localhost (unknown [192.168.200.7])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id E0D683CFE88;\r
+       Wed, 19 Dec 2012 22:39:24 +0100 (CET)\r
+X-Virus-Scanned: IMAP STYX AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+       by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new,\r
+       port 10044)\r
+       with ESMTP id yi_hg2MnMMbp; Wed, 19 Dec 2012 22:39:23 +0100 (CET)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id 3716719F30DA;\r
+       Wed, 19 Dec 2012 22:39:23 +0100 (CET)\r
+Received: from steelpick.2x.cz (unknown [213.29.198.144])\r
+       (Authenticated sender: sojkam1)\r
+       by imap.feld.cvut.cz (Postfix) with ESMTPSA id 080D8660904;\r
+       Wed, 19 Dec 2012 22:39:23 +0100 (CET)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.80)\r
+       (envelope-from <sojkam1@fel.cvut.cz>)\r
+       id 1TlRMD-00079N-KE; Wed, 19 Dec 2012 22:39:17 +0100\r
+From: Michal Sojka <sojka@os.inf.tu-dresden.de>\r
+To: Jani Nikula <jani@nikula.org>, david@tethera.net, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] test: Adding non-maildir tags does not move message from\r
+       new to cur\r
+In-Reply-To: <87vcccp4y3.fsf@nikula.org>\r
+References: <1316039001-32602-5-git-send-email-l.rilling@av7.net>\r
+       <1354994132-866-1-git-send-email-david@tethera.net>\r
+       <87vcccp4y3.fsf@nikula.org>\r
+User-Agent: Notmuch/0.14+107~g342038e (http://notmuchmail.org) Emacs/24.2.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Wed, 19 Dec 2012 22:39:17 +0100\r
+Message-ID: <87mwx9g1ru.fsf@steelpick.2x.cz>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 19 Dec 2012 21:39:27 -0000\r
+\r
+Hello Jani,\r
+\r
+On Sat, Dec 08 2012, Jani Nikula wrote:\r
+> On Sat, 08 Dec 2012, david@tethera.net wrote:\r
+>> From: Michal Sojka <sojka@os.inf.tu-dresden.de>\r
+>>\r
+>> Some MUA's like mutt show the difference between "new" emails living in maildir\r
+>> directory new/, and "old" emails living in maildir directory cur/. However\r
+>> notmuch tag unconditionally moves selected messages from new/ to cur/, even if\r
+>> no maildir synchronized tag is changed.\r
+>>\r
+>> While maildir specification forbids messages with tags living in new/, there is\r
+>> no need to move messages to cur/ when no maildir synchronized tag is changed.\r
+>> Thus notmuch can remain transparent with respect to other MUA's.\r
+>>\r
+>> [ Edited commit log to better describe the intended changes, and tag the\r
+>>   test as broken until the actual changes are implemented -- Louis Rilling ]\r
+>>\r
+>> Signed-off-by: Louis Rilling <l.rilling@av7.net>\r
+>>\r
+>> [ Converted to use test_subtest_known_broken, David Bremner ]\r
+>> ---\r
+>>\r
+>> Do we agree that the behaviour of moving messages to ./cur on tagging\r
+>> is broken? If so, maybe it's worth tidying up and applying this.  The\r
+>> use of cd and ls strikes me as slightly suspect, but I welcome other\r
+>> opinions.\r
+>\r
+> I think I would narrow down the special case a bit: I think messages in\r
+> ./new that have no maildir flags, and have no ":2," in the end of the\r
+> filename, and and the tag change(s) will not affect maildir flags,\r
+> should stay in ./new. Files in ./new should not have ":2," or maildir\r
+> flags, and I see no reason to support having them there.\r
+>\r
+> Thus any messages in ./new that do have maildir flags, or have ":2," in\r
+> the end of the filename should probably be moved to ./cur, even if the\r
+> tag change(s) do not affect maildir flags. The patch in this thread\r
+> fails here. It also changes the behaviour for messages in ./cur by not\r
+> appending ":2," to them.\r
+\r
+I agree with you. In\r
+id:1355952747-27350-1-git-send-email-sojkam1@fel.cvut.cz I sent the\r
+tests for the cases descried above as well as the updated patch for tag\r
+to maildir synchronization.\r
+\r
+> As to the test, I think it should do something along the lines of (based\r
+> on search-output test):\r
+>\r
+> notmuch search --output=files subject:"Message to stay in new" | sed -e "s,$MAIL_DIR,MAIL_DIR," >OUTPUT\r
+> cat <<EOF >EXPECTED\r
+> MAIL_DIR/new/message-to-stay-in-new\r
+> EOF\r
+> test_expect_equal_file OUTPUT EXPECTED\r
+\r
+With this you test what notmuch thinks about the file names of messages,\r
+not whether the files have actually been renamed. For this reason I kept\r
+the previous way of testing in the new patches.\r
+\r
+Cheers,\r
+-Michal\r