Re: [PATCH 6/8] cli: add support for batch tagging operations to "notmuch tag"
authorDavid Bremner <bremner@unb.ca>
Wed, 4 Apr 2012 10:55:24 +0000 (07:55 +2100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:02 +0000 (09:46 -0800)
2d/42172e54e03f1703a90ffa45080be01bdb7286 [new file with mode: 0644]

diff --git a/2d/42172e54e03f1703a90ffa45080be01bdb7286 b/2d/42172e54e03f1703a90ffa45080be01bdb7286
new file mode 100644 (file)
index 0000000..6409482
--- /dev/null
@@ -0,0 +1,121 @@
+Return-Path: <bremner@unb.ca>\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 4B633431FB6\r
+       for <notmuch@notmuchmail.org>; Wed,  4 Apr 2012 03:55:39 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       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 BYHRANrjliv6 for <notmuch@notmuchmail.org>;\r
+       Wed,  4 Apr 2012 03:55:37 -0700 (PDT)\r
+Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])\r
+       (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id C4BD1431FAE\r
+       for <notmuch@notmuchmail.org>; Wed,  4 Apr 2012 03:55:37 -0700 (PDT)\r
+Received: from fctnnbsc30w-156034089108.dhcp-dynamic.fibreop.nb.bellaliant.net\r
+       ([156.34.89.108] helo=zancas.localnet)\r
+       by tesseract.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)\r
+       (Exim 4.72) (envelope-from <bremner@unb.ca>)\r
+       id 1SFNsA-0008HH-5J; Wed, 04 Apr 2012 07:55:30 -0300\r
+Received: from bremner by zancas.localnet with local (Exim 4.77)\r
+       (envelope-from <bremner@unb.ca>)\r
+       id 1SFNs4-0004qY-Ms; Wed, 04 Apr 2012 07:55:24 -0300\r
+From: David Bremner <bremner@unb.ca>\r
+To: Jameson Graef Rollins <jrollins@finestructure.net>,\r
+       Jani Nikula <jani@nikula.org>\r
+Subject: Re: [PATCH 6/8] cli: add support for batch tagging operations to\r
+       "notmuch tag"\r
+In-Reply-To: <87aa2s2aow.fsf@servo.finestructure.net>\r
+References: <cover.1333231401.git.jani@nikula.org>\r
+       <f360a40bed50208d146aee8b06946b1b8315e818.1333231401.git.jani@nikula.org>\r
+       <87ty123tpc.fsf@servo.finestructure.net>\r
+       <87aa2tc22z.fsf@zancas.localnet>\r
+       <87iphh50hz.fsf@servo.finestructure.net>\r
+       <CAB+hUn_J9oOmbWaQ+_2yGG6i6ecDXbfJWYbpaYx_kbSnAH+EcA@mail.gmail.com>\r
+       <87fwcl4yr8.fsf@servo.finestructure.net>\r
+       <CAB+hUn-5yB15na2kFMZOjOEujKQTWHiefvgQYsT4Zi3UOzKwQw@mail.gmail.com>\r
+       <87d37p4xor.fsf@servo.finestructure.net>\r
+       <87pqbpxm2c.fsf@nikula.org>\r
+       <87wr5w2zv5.fsf@servo.finestructure.net>\r
+       <87bon82qok.fsf@zancas.localnet>\r
+       <87aa2s2aow.fsf@servo.finestructure.net>User-Agent:\r
+       Notmuch/0.12+70~g46e73fe (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Wed, 04 Apr 2012 07:55:24 -0300\r
+Message-ID: <878vib3gwz.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Spam_bar: -\r
+Cc: Notmuch Mail <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: Wed, 04 Apr 2012 10:55:39 -0000\r
+\r
+Jameson Graef Rollins <jrollins@finestructure.net> writes:\r
+\r
+> With that in mind, I think I stand by my suggestion that the form should\r
+> match exactly the notmuch subcommand format.  Even considering the\r
+> technical issues that Jani brought up, I still think it makes the most\r
+> sense to imagine generic batch processing handled by the top level\r
+> binary.  And in that case the most logical format for the input is\r
+> probably just that of the CLI arguments.\r
+\r
+One thing that worries me about this (and to be honest it worries me a\r
+bit about the single character command tag) is the potential increase in\r
+size of a dump file, if we use exactly a list of commands as a dump\r
+format. The SQL/XML-like argument that it will all compress well is\r
+true; nontheless for applications involving version control, it does\r
+seem useful to have an uncompressed version around.\r
+\r
+A very rough estimate suggests for my about 250k messages, appending\r
+"tag " to the front of each line bloats a dump file by about 5%. Maybe\r
+that is not worth worrying about. I'd be curious to see how 4 * #lines /\r
+(total dump size) works out for other people.  I thought that the bloat\r
+from having + in front of every tag would be larger, but it seems that\r
+my messages average something like one tag per message (many messages\r
+with no tags). I'm not sure how universal that is.\r
+\r
+We could also give up on marking the command on each line, and insert\r
+some kind of simple header at the top. This idea came up in the context\r
+of restore formats before.\r
+\r
+> Just out of curiosity and for the sake of argument, if we were going to\r
+> design a server/batch processor from the ground up would it make sense\r
+> to use a format like this, or would we better off opting for some other\r
+> more established protocol?\r
+\r
+I guess it depends how much work it is to support the established\r
+protocol, and how good the fit is with notmuch.  Are there candidates\r
+other than IMAP? \r
+\r
+As far as implementation effort, as a totally unscientific experiment, I\r
+grabbed Net::IMAP::Server from CPAN, it is almost 7000 lines of\r
+perl. I'm not suggesting we use Perl ;), but I doubt C is\r
+shorter. Hopefully we wouldn't write such a library from scratch.  A\r
+quick search did not lead me to "the canonical imap server library",\r
+unless that is the UW one, which I have bad, if non-specific memories\r
+about.\r
+\r
+I think we'd need to use a fair number of extensions to basic IMAP. What\r
+might work well is the GMail extensions to IMAP. I have no idea about\r
+the difficulty of implementing those; I suspect there are not solid C\r
+libraries supporting them.\r
+\r
+d\r