From: Jani Nikula Date: Sat, 14 Apr 2012 21:07:53 +0000 (+0300) Subject: Re: [PATCH v2 0/6] batch tagging support: "notmuch tag --stdin" X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=b2de610ea0cb2706836415984b87dda9f8710dfe;p=notmuch-archives.git Re: [PATCH v2 0/6] batch tagging support: "notmuch tag --stdin" --- diff --git a/3e/63f0ee9ba257a6ad737323e96a5509ee62b8c9 b/3e/63f0ee9ba257a6ad737323e96a5509ee62b8c9 new file mode 100644 index 000000000..f0fc13590 --- /dev/null +++ b/3e/63f0ee9ba257a6ad737323e96a5509ee62b8c9 @@ -0,0 +1,119 @@ +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 8238C431FAF + for ; Sat, 14 Apr 2012 14:08:00 -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 OzCN4Oi4oKe0 for ; + Sat, 14 Apr 2012 14:07:59 -0700 (PDT) +Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com + [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 8D489431FAE + for ; Sat, 14 Apr 2012 14:07:59 -0700 (PDT) +Received: by lbdb5 with SMTP id b5so209047lbd.26 + for ; Sat, 14 Apr 2012 14:07:57 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=from:to:subject:in-reply-to:references:date:message-id:mime-version + :content-type:x-gm-message-state; + bh=gjmilRSK9VpeQw12soVGWPOsxZqIZqILR+xwf7F76qg=; + b=SKA+35VkydQUQKPLt/wbEKsdFiSxXtCbVSIG0jaqWSeBe2917KIqyrpwbe9LlqlJAk + SQ7yoXyXTSg/icnrLfNaQwDZ4PLGkwR7YzjBy2NzsSYY7+D+eQccjISHj6CApxd35ECp + RSjPKU3xXXsYR+nAtb+E032rPonRW9iaUxZyUHnKqMPhiKNb+BROwhkVh/I9dqrw3ga1 + OhECn2HLFQdyDT0XuzfyN/F7eu3vPjO/oz45Y0XRBheR56Rv/jiGWa3oD4NHyI9rqHxS + oDomSQNMMtizVqqyyJ3aL7J0puhl2j3Yh1V0kGIHQq/K4ELdveu32D1GvbSxDutBPIW3 + JiOw== +Received: by 10.152.129.137 with SMTP id nw9mr5601976lab.48.1334437677714; + Sat, 14 Apr 2012 14:07:57 -0700 (PDT) +Received: from localhost (dsl-hkibrasgw4-fe50dc00-68.dhcp.inet.fi. + [80.220.80.68]) + by mx.google.com with ESMTPS id ox7sm17565061lbb.17.2012.04.14.14.07.55 + (version=SSLv3 cipher=OTHER); Sat, 14 Apr 2012 14:07:56 -0700 (PDT) +From: Jani Nikula +To: Jameson Graef Rollins , + notmuch@notmuchmail.org +Subject: Re: [PATCH v2 0/6] batch tagging support: "notmuch tag --stdin" +In-Reply-To: <87d37ays85.fsf@servo.finestructure.net> +References: + <87d37ays85.fsf@servo.finestructure.net>User-Agent: + Notmuch/0.12+81~g839a805 (http://notmuchmail.org) Emacs/23.3.1 + (i686-pc-linux-gnu) +Date: Sun, 15 Apr 2012 00:07:53 +0300 +Message-ID: <87ty0mdnti.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Gm-Message-State: + ALoCoQkDsgaK8XSM7ekX7NfU3IjVRQXrXwVmAtVqJKd4Rq+g5dbKvRqz1mmeoKj7/Rozw5jpRoVg +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: Sat, 14 Apr 2012 21:08:00 -0000 + +Jameson Graef Rollins writes: + +> On Sat, Apr 14 2012, Jani Nikula wrote: +>> This series adds support for batch tagging through stdin to "notmuch +>> tag". This should be useful and efficient for e.g. initial tagging +>> scripts. Also, this adds locking around a batch of tag changes, which is +>> also useful for initial tagging scripts. See the test patch for an +>> example using a "here document". +> +> My issues from v1 still stand. I would rather see some unification with +> the existing tag file format, rather than introduce a second format, +> with it's increased maintenance burden and confusion to users. Either +> that or a more general batch command interface. + +The existing dump/restore file format is a dead end. It fails +magnificently with tags and message-ids that have spaces or some other +special characters in them. It doesn't support removal of tags. There's +zero room for extensibility. I can't imagine how that could be used for +notmuch tag. + +David originally wrote the dump/restore patches +id:"1324214111-32079-1-git-send-email-david@tethera.net" to add a +"notmuch" format (yes, a second format) in addition to the "sup" format +we currently have, to fix the issues with special characters. That too +lacked features to support batch tagging in notmuch new. The format +proposed here would fix the issues and work with notmuch tag, and it +would be obvious to use for anyone who has used notmuch tag. + +I see a general batch command interface overkill. Too many problems to +solve for little gain (see the previous thread for details). What other +notmuch commands than tag would really benefit from it? If you want to +do search or show or whatever, the general batch command interface to +use is /bin/sh. + +For notmuch tag, particularly in connection with notmuch new, there's a +clear benefit in having a batch mode: if you have "new" in new.tags, and +do initial tagging on the "new" tagged messages (e.g. in post-new hook), +you don't want anyone messing with the database while you're processing +the messages tagged "new". The batch tagging of this series keeps the db +locked for the duration of such initial tagging. + +I'm totally fine with modifying the proposed format (e.g. change "T" to +"tag", make things compatible with a future general batch mode), but to +be absolutely clear: I will not implement a general batch command +mode. If that is deemed to be what is wanted, that's okay too. I can +share my WIP patches for dump/restore, and focus on something else. + + +BR, +Jani.