Re: Add support for specifying tags during "notmuch new"
authorAustin Clements <amdragon@MIT.EDU>
Fri, 2 May 2014 15:18:01 +0000 (11:18 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:02:06 +0000 (10:02 -0800)
85/0710ad4d6f35ee12c3195df9d16cdf724f6ff6 [new file with mode: 0644]

diff --git a/85/0710ad4d6f35ee12c3195df9d16cdf724f6ff6 b/85/0710ad4d6f35ee12c3195df9d16cdf724f6ff6
new file mode 100644 (file)
index 0000000..6221e14
--- /dev/null
@@ -0,0 +1,106 @@
+Return-Path: <amdragon@mit.edu>\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 370CA429E3E\r
+       for <notmuch@notmuchmail.org>; Fri,  2 May 2014 08:18:18 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 0s9AnBD0fVd6 for <notmuch@notmuchmail.org>;\r
+       Fri,  2 May 2014 08:18:14 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu\r
+       [18.9.25.15])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 7E0FD429E32\r
+       for <notmuch@notmuchmail.org>; Fri,  2 May 2014 08:18:14 -0700 (PDT)\r
+X-AuditID: 1209190f-f790b6d000000c3a-83-5363b735c6b4\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+       (using TLS with cipher AES256-SHA (256/256 bits))\r
+       (Client did not present a certificate)\r
+       by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id A1.CB.03130.537B3635; Fri,  2 May 2014 11:18:13 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+       by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id s42FICRZ025286; \r
+       Fri, 2 May 2014 11:18:13 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s42FI9rd012332\r
+       (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
+       Fri, 2 May 2014 11:18:11 -0400\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1WgFDx-0001nN-9g; Fri, 02 May 2014 11:18:08 -0400\r
+Date: Fri, 2 May 2014 11:18:01 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: David Edmondson <dme@dme.org>\r
+Subject: Re: Add support for specifying tags during "notmuch new"\r
+Message-ID: <20140502151800.GC8365@mit.edu>\r
+References: <1399018555-1994-1-git-send-email-dme@dme.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1399018555-1994-1-git-send-email-dme@dme.org>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IR4hRV1jXdnhxssPKqjsW+O1uYLK7fnMns\r
+       wOSx6/lfJo9nq24xBzBFcdmkpOZklqUW6dslcGXcmjOXtWALV8XSOwsYGxi/s3cxcnJICJhI\r
+       nGmexwRhi0lcuLeerYuRi0NIYDaTRMPNI6wQzgZGiWc3ZrJAOKeYJKY+/s4M4SxhlJhz9Bkr\r
+       SD+LgIrE1HmHwGaxCWhIbNu/nBHEFhFQlPj/bQXYPmYBaYlvv5vBaoQFHCWereoG6uXg4BXQ\r
+       ljhx1g0kLCRgJbGq9TEziM0rIChxcuYTFohWLYkb/14ygZSDjFn+jwPE5BSwlnj6TBekQhTo\r
+       gCknt7FNYBSahaR5FpLmWQjNCxiZVzHKpuRW6eYmZuYUpybrFicn5uWlFuma6OVmluilppRu\r
+       YgQHtST/DsZvB5UOMQpwMCrx8GZEJQULsSaWFVfmHmKU5GBSEuW9sCE5WIgvKT+lMiOxOCO+\r
+       qDQntfgQowQHs5II77MSoBxvSmJlVWpRPkxKmoNFSZz3rbVVsJBAemJJanZqakFqEUxWhoND\r
+       SYJ36jagRsGi1PTUirTMnBKENBMHJ8hwHqDh80FqeIsLEnOLM9Mh8qcYFaXEeSeDJARAEhml\r
+       eXC9sKTzilEc6BVh3naQKh5gwoLrfgU0mAlosLgj2OCSRISUVAPjJFHfTwZ8dyZXejmoNi6w\r
+       2hZw8mN1bFDe9BWNDtml6v3SJb2bjmzXOJvJfoNXSZx5d0/WFw+D68W2mx1l7eYwfv37xea/\r
+       esqsqOzqWUvb4lTyNny5mT4j6fmTJYuOhYZJfjv38hrTfM2qFaEhh+ZPDEvmPrzv4RGmsoSa\r
+       irVhV0RfhMzQuv1QiaU4I9FQi7moOBEAG9SRnRUDAAA=\r
+Cc: notmuch@notmuchmail.org\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: Fri, 02 May 2014 15:18:18 -0000\r
+\r
+Quoth David Edmondson on May 02 at  9:15 am:\r
+> This patch set allows a user to specify a list of tags to be\r
+> added/removed to messages discovered during "notmuch new".\r
+> \r
+> Two use-cases are envisaged:\r
+>     1) A chunk of messages was just dumped into the configured\r
+>        directory by hand, and the user doesn't want the 'inbox' tag\r
+>        applied to them. Run 'notmuch new -inbox'.\r
+>     2) A periodic mail processing script wants to add new messages to\r
+>        the database, then process those newly added messages to add\r
+>        convenience tags, etc. without worrying about the user or other\r
+>        instances of the script manipulating tags at the same time. Use\r
+>        this approach:\r
+>          KEY=$RANDOM\r
+>       notmuch new +$KEY\r
+>       notmuch tag +notmuch tag:$KEY and to:notmuch@notmuchmail.org\r
+>       notmuch tag +gnus tag:$KEY and to:ding@gnus.org\r
+>       ...\r
+>       notmuch tag -$KEY tag:$KEY\r
+\r
+What happens when this script dies in the middle (say, your computer\r
+loses power or notmuch tag conflicts with something else on the write\r
+lock)?  One advantage of the standard "new" tag approach is that it's\r
+easy to write a stateless post-new tagging script that can be killed\r
+at any point and restarted.  (You're right that post-new has a\r
+concurrency issue, but we should fix that in its own right.)\r