Re: [PATCH 1/2] Add 'cat' subcommand
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 22 Apr 2010 06:38:54 +0000 (08:38 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:46 +0000 (09:36 -0800)
10/fcb726649fa2df9cc8ec4ef3538658e95c8b42 [new file with mode: 0644]

diff --git a/10/fcb726649fa2df9cc8ec4ef3538658e95c8b42 b/10/fcb726649fa2df9cc8ec4ef3538658e95c8b42
new file mode 100644 (file)
index 0000000..e684627
--- /dev/null
@@ -0,0 +1,109 @@
+Return-Path: <sojkam1@fel.cvut.cz>\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 5307A4196F2\r
+       for <notmuch@notmuchmail.org>; Wed, 21 Apr 2010 23:38:59 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.9\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9] autolearn=unavailable\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 Uwzf2fyqVF5I for <notmuch@notmuchmail.org>;\r
+       Wed, 21 Apr 2010 23:38:57 -0700 (PDT)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id 5574D431FC1\r
+       for <notmuch@notmuchmail.org>; Wed, 21 Apr 2010 23:38:57 -0700 (PDT)\r
+Received: from localhost (unknown [192.168.200.4])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id 8518619F33B8;\r
+       Thu, 22 Apr 2010 08:38:56 +0200 (CEST)\r
+X-Virus-Scanned: IMAP AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+       by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
+       port 10044)\r
+       with ESMTP id COHVWyzCROfp; Thu, 22 Apr 2010 08:38:55 +0200 (CEST)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id 4CFBB19F339B;\r
+       Thu, 22 Apr 2010 08:38:55 +0200 (CEST)\r
+Received: from steelpick.2x.cz (k335-30.felk.cvut.cz [147.32.86.30])\r
+       (Authenticated sender: sojkam1)\r
+       by imap.feld.cvut.cz (Postfix) with ESMTPSA id 19C4115C062;\r
+       Thu, 22 Apr 2010 08:38:54 +0200 (CEST)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.71)\r
+       (envelope-from <sojkam1@fel.cvut.cz>)\r
+       id 1O4q3q-0001vm-Cz; Thu, 22 Apr 2010 08:38:54 +0200\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: Carl Worth <cworth@cworth.org>\r
+Subject: Re: [PATCH 1/2] Add 'cat' subcommand\r
+In-Reply-To: <871ve8wc30.fsf@yoom.home.cworth.org>\r
+References: <1271747793-17507-1-git-send-email-sojkam1@fel.cvut.cz>\r
+       <87pr1u7fnu.fsf@ut.hh.sledj.net> <87fx2qmtok.fsf@SSpaeth.de>\r
+       <4BCD7EA0.3080505@fel.cvut.cz>\r
+       <871ve8wc30.fsf@yoom.home.cworth.org>\r
+Date: Thu, 22 Apr 2010 08:38:54 +0200\r
+Message-ID: <871ve8ng8x.fsf@steelpick.2x.cz>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Cc: 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: Thu, 22 Apr 2010 06:39:00 -0000\r
+\r
+On Thu, 22 Apr 2010, Carl Worth wrote:\r
+> On Tue, 20 Apr 2010 12:14:56 +0200, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
+> > On 20.4.2010 09:21, David Edmondson wrote:\r
+> >  > I'm puzzled why you chose to pass a filename as the argument to 'cat'\r
+> >  > rather than a message id (id:foo@bar.com)?\r
+> > \r
+> > The reason is that I want be able to distinguish between several \r
+> > messages with the same id.\r
+> \r
+> All other commands currently accept the generic search terms to specify\r
+> messages, (even a command like "notmuch reply" for which it would have\r
+> been natural to accept only a single message).\r
+> \r
+> So I'd prefer to have this command behave just like all others and use\r
+> the same naming.\r
+> \r
+> The question of how to unambiguously refer to a single file is\r
+> orthogonal, (and similarly applies to all commands, such as "notmuch\r
+> tag" etc.). I would recommend supporting a search syntax something like:\r
+> \r
+>      filename:/complete/path/to/file\r
+> \r
+> for that use case. And this should work fine whether the filenames are\r
+> actual filenames or keys into some abstract file store of some sort.\r
+> \r
+> What do you think?\r
+\r
+It sounds reasonable. I looked at the code to see how this could be\r
+implemented and I have a few questions:\r
+\r
+If a filename:dir/file term is present in the query, it will be\r
+necessary to first query the database for directory:dir to find the\r
+<directory_ID> and then put in the query\r
+file-direntry:<directory_ID>:file. This conversion is already\r
+implemented in _notmuch_database_filename_to_direntry(). Right?\r
+\r
+_notmuch_database_filename_to_direntry() requires writable database as\r
+it creates the directory document if it doesn't exist. This is probably\r
+not what we want for filename: queries - if the user types the filename\r
+incorrectly, the nonexisting directory document could be added to the\r
+database. So I think that _notmuch_database_find_directory_id() should\r
+be modified to not modify the database. The directory documents should\r
+be created somewhere else in notmuch new path. Do you agree?\r
+\r
+-Michal\r