From 0556ca0eb2996627a8cf7f6056233a8b2324b4c4 Mon Sep 17 00:00:00 2001 From: David Edmondson Date: Fri, 2 May 2014 16:32:50 +0100 Subject: [PATCH] Re: Add support for specifying tags during "notmuch new" --- e6/f183c762b7887b1ce094e72695600d7c0dcc41 | 115 ++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 e6/f183c762b7887b1ce094e72695600d7c0dcc41 diff --git a/e6/f183c762b7887b1ce094e72695600d7c0dcc41 b/e6/f183c762b7887b1ce094e72695600d7c0dcc41 new file mode 100644 index 000000000..69c3e9ade --- /dev/null +++ b/e6/f183c762b7887b1ce094e72695600d7c0dcc41 @@ -0,0 +1,115 @@ +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 CC6DB429E41 + for ; Fri, 2 May 2014 08:33:05 -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 0iWrR0gF8aoo for ; + Fri, 2 May 2014 08:33:02 -0700 (PDT) +Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com + [74.125.82.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + BF662429E32 for ; Fri, 2 May 2014 08:33:01 -0700 + (PDT) +Received: by mail-wg0-f43.google.com with SMTP id l18so3798366wgh.14 + for ; Fri, 02 May 2014 08:32:59 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:to:cc:subject:in-reply-to:references:user-agent + :from:date:message-id:mime-version:content-type; + bh=a7ioiZCitu4sP+xFu3sRNL6jZ3NCBX3jawYjfalPvrw=; + b=fG7vNrgOpSyKv915dlMFvmXxir0/X3nU+0aJo8R3BQT2Amky6fsnJGwD6T8G3WZ+Jb + h1LiFeJY7UiReyYGPEjPaviZVk0TYAw0apob6GNEwoEruTr1pGNN3M9LMr9CbXPJI6js + Xv0XIzN7Sy5RppEaf39fd7Q5Y4WCR/k8CXLtql1sU9sNZ+E+dVkF0J6esc4ObGSrjxNZ + B9OKVnU6ACZzZuAZf6nbaNkzU06skmiMPZ1y0NnxqSAqtuagnW7PpVOdnl/jnKaaEzSw + +mLd8RpsDvhhhzjBdswzZPYj0QTulrSi0neP99PCPROY55ZvFpR6Xedv7/XDAn1dN8vZ + ybmg== +X-Gm-Message-State: + ALoCoQmHOeMN18ZXn4SPonAYregKRX4JJvz8/FV3f+7lBkn9yJANPbctKFC6gxHVTyXwUQxdUgYE +X-Received: by 10.180.91.1 with SMTP id ca1mr3526268wib.32.1399044778278; + Fri, 02 May 2014 08:32:58 -0700 (PDT) +Received: from localhost ([2a01:348:1a2:1:a288:b4ff:fe8a:77d8]) + by mx.google.com with ESMTPSA id vc2sm2661022wjc.2.2014.05.02.08.32.56 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Fri, 02 May 2014 08:32:57 -0700 (PDT) +To: Austin Clements +Subject: Re: Add support for specifying tags during "notmuch new" +In-Reply-To: <20140502151800.GC8365@mit.edu> +References: <1399018555-1994-1-git-send-email-dme@dme.org> + <20140502151800.GC8365@mit.edu> +User-Agent: Notmuch/0.18~rc0 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +From: David Edmondson +Date: Fri, 02 May 2014 16:32:50 +0100 +Message-ID: +MIME-Version: 1.0 +Content-Type: multipart/signed; boundary="=-=-="; + micalg=pgp-sha1; protocol="application/pgp-signature" +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:33:06 -0000 + +--=-=-= +Content-Type: text/plain + +On Fri, May 02 2014, Austin Clements wrote: +>> 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)? + +It's a problem. I think that I would actually add both 'new' and +'new-$seconds' tags (given that I can't search on wildcarded tags) and +have 'notmuch tag' use only 'new-$seconds'. + +The 'new' tag would help recover from failures such as you describe. + +> 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.) + +--=-=-= +Content-Type: application/pgp-signature; name="signature.asc" + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iKYEARECAGYFAlNjuqJfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl +bnBncC5maWZ0aGhvcnNlbWFuLm5ldDc1M0Y5NDJDMEExNjc3MDE4OURGMUYyMDY5 +RUNEMEFCRjA0OTY1MTYACgkQaezQq/BJZRZP3gCfbWjsjtXd0IuVlKO5pOZx9p+N +k0MAn1MlRr4mP5MID80FwxpYDnWhAHJF +=DKrB +-----END PGP SIGNATURE----- +--=-=-=-- -- 2.26.2