[PATCH 6/8] CLI: refactor dumping of tags.
[notmuch-archives.git] / 85 / 0710ad4d6f35ee12c3195df9d16cdf724f6ff6
1 Return-Path: <amdragon@mit.edu>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 370CA429E3E\r
6         for <notmuch@notmuchmail.org>; Fri,  2 May 2014 08:18:18 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 0s9AnBD0fVd6 for <notmuch@notmuchmail.org>;\r
16         Fri,  2 May 2014 08:18:14 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu\r
18         [18.9.25.15])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 7E0FD429E32\r
22         for <notmuch@notmuchmail.org>; Fri,  2 May 2014 08:18:14 -0700 (PDT)\r
23 X-AuditID: 1209190f-f790b6d000000c3a-83-5363b735c6b4\r
24 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
25         (using TLS with cipher AES256-SHA (256/256 bits))\r
26         (Client did not present a certificate)\r
27         by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
28         id A1.CB.03130.537B3635; Fri,  2 May 2014 11:18:13 -0400 (EDT)\r
29 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
30         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id s42FICRZ025286; \r
31         Fri, 2 May 2014 11:18:13 -0400\r
32 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
33         (authenticated bits=0)\r
34         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
35         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s42FI9rd012332\r
36         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
37         Fri, 2 May 2014 11:18:11 -0400\r
38 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
39         (envelope-from <amdragon@mit.edu>)\r
40         id 1WgFDx-0001nN-9g; Fri, 02 May 2014 11:18:08 -0400\r
41 Date: Fri, 2 May 2014 11:18:01 -0400\r
42 From: Austin Clements <amdragon@MIT.EDU>\r
43 To: David Edmondson <dme@dme.org>\r
44 Subject: Re: Add support for specifying tags during "notmuch new"\r
45 Message-ID: <20140502151800.GC8365@mit.edu>\r
46 References: <1399018555-1994-1-git-send-email-dme@dme.org>\r
47 MIME-Version: 1.0\r
48 Content-Type: text/plain; charset=us-ascii\r
49 Content-Disposition: inline\r
50 In-Reply-To: <1399018555-1994-1-git-send-email-dme@dme.org>\r
51 User-Agent: Mutt/1.5.21 (2010-09-15)\r
52 X-Brightmail-Tracker:\r
53  H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IR4hRV1jXdnhxssPKqjsW+O1uYLK7fnMns\r
54         wOSx6/lfJo9nq24xBzBFcdmkpOZklqUW6dslcGXcmjOXtWALV8XSOwsYGxi/s3cxcnJICJhI\r
55         nGmexwRhi0lcuLeerYuRi0NIYDaTRMPNI6wQzgZGiWc3ZrJAOKeYJKY+/s4M4SxhlJhz9Bkr\r
56         SD+LgIrE1HmHwGaxCWhIbNu/nBHEFhFQlPj/bQXYPmYBaYlvv5vBaoQFHCWereoG6uXg4BXQ\r
57         ljhx1g0kLCRgJbGq9TEziM0rIChxcuYTFohWLYkb/14ygZSDjFn+jwPE5BSwlnj6TBekQhTo\r
58         gCknt7FNYBSahaR5FpLmWQjNCxiZVzHKpuRW6eYmZuYUpybrFicn5uWlFuma6OVmluilppRu\r
59         YgQHtST/DsZvB5UOMQpwMCrx8GZEJQULsSaWFVfmHmKU5GBSEuW9sCE5WIgvKT+lMiOxOCO+\r
60         qDQntfgQowQHs5II77MSoBxvSmJlVWpRPkxKmoNFSZz3rbVVsJBAemJJanZqakFqEUxWhoND\r
61         SYJ36jagRsGi1PTUirTMnBKENBMHJ8hwHqDh80FqeIsLEnOLM9Mh8qcYFaXEeSeDJARAEhml\r
62         eXC9sKTzilEc6BVh3naQKh5gwoLrfgU0mAlosLgj2OCSRISUVAPjJFHfTwZ8dyZXejmoNi6w\r
63         2hZw8mN1bFDe9BWNDtml6v3SJb2bjmzXOJvJfoNXSZx5d0/WFw+D68W2mx1l7eYwfv37xea/\r
64         esqsqOzqWUvb4lTyNny5mT4j6fmTJYuOhYZJfjv38hrTfM2qFaEhh+ZPDEvmPrzv4RGmsoSa\r
65         irVhV0RfhMzQuv1QiaU4I9FQi7moOBEAG9SRnRUDAAA=\r
66 Cc: notmuch@notmuchmail.org\r
67 X-BeenThere: notmuch@notmuchmail.org\r
68 X-Mailman-Version: 2.1.13\r
69 Precedence: list\r
70 List-Id: "Use and development of the notmuch mail system."\r
71         <notmuch.notmuchmail.org>\r
72 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
73         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
74 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
75 List-Post: <mailto:notmuch@notmuchmail.org>\r
76 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
77 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
78         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
79 X-List-Received-Date: Fri, 02 May 2014 15:18:18 -0000\r
80 \r
81 Quoth David Edmondson on May 02 at  9:15 am:\r
82 > This patch set allows a user to specify a list of tags to be\r
83 > added/removed to messages discovered during "notmuch new".\r
84\r
85 > Two use-cases are envisaged:\r
86 >     1) A chunk of messages was just dumped into the configured\r
87 >        directory by hand, and the user doesn't want the 'inbox' tag\r
88 >        applied to them. Run 'notmuch new -inbox'.\r
89 >     2) A periodic mail processing script wants to add new messages to\r
90 >        the database, then process those newly added messages to add\r
91 >        convenience tags, etc. without worrying about the user or other\r
92 >        instances of the script manipulating tags at the same time. Use\r
93 >        this approach:\r
94 >          KEY=$RANDOM\r
95 >        notmuch new +$KEY\r
96 >        notmuch tag +notmuch tag:$KEY and to:notmuch@notmuchmail.org\r
97 >        notmuch tag +gnus tag:$KEY and to:ding@gnus.org\r
98 >        ...\r
99 >        notmuch tag -$KEY tag:$KEY\r
100 \r
101 What happens when this script dies in the middle (say, your computer\r
102 loses power or notmuch tag conflicts with something else on the write\r
103 lock)?  One advantage of the standard "new" tag approach is that it's\r
104 easy to write a stateless post-new tagging script that can be killed\r
105 at any point and restarted.  (You're right that post-new has a\r
106 concurrency issue, but we should fix that in its own right.)\r