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