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 2753E40D155 for ; Thu, 4 Nov 2010 12:26:07 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.89 X-Spam-Level: X-Spam-Status: No, score=-2.89 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, T_MIME_NO_TEXT=0.01] autolearn=ham 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 d9tCtO1sPwF1; Thu, 4 Nov 2010 12:25:56 -0700 (PDT) Received: from yoom.home.cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id B50714196F0; Thu, 4 Nov 2010 12:25:56 -0700 (PDT) Received: by yoom.home.cworth.org (Postfix, from userid 1000) id 4566F254102; Thu, 4 Nov 2010 12:25:56 -0700 (PDT) From: Carl Worth To: Michal Sojka , notmuch@notmuchmail.org Subject: Re: [PATCH 0/2] Notmuch cat v2 In-Reply-To: <1287739684-26188-1-git-send-email-sojkam1@fel.cvut.cz> References: <1287739684-26188-1-git-send-email-sojkam1@fel.cvut.cz> User-Agent: Notmuch/0.4 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) Date: Thu, 04 Nov 2010 12:25:56 -0700 Message-ID: <874obwriuz.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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: Thu, 04 Nov 2010 19:26:07 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Fri, 22 Oct 2010 11:28:02 +0200, Michal Sojka wrot= e: > this is my second attempt to implement notmuch cat subcommand (the > first version was posted in > id:1271747793-17507-1-git-send-email-sojkam1@fel.cvut.cz). This > subcommand outputs the given message to stdout. Hi Michal, I'm *really* excited about this feature. The ability to more easily use notmuch over ssh is really appealing, and as I mentioned previously, I see this patch as a prerequisite for the maildir-synchronization work. > In this version the arguments are classical notmuch search terms and > not a filename as in the previous version. Emacs interface then uses > message-id to retrieve the message. Excellent. This is much better than before. > Some people suggested that cat could be implemented as a special > format of show subcommand. That would be possible, but it seems that > show command always constructs threads form the messages which means > that is executes several database queries. I consider this as > unnecessary overhead and for that reason cat is a separate subcommand. So I'll argue for "notmuch show --format=3Draw" here. You're correct that the current implementation of "notmuch show" calls notmuch_database_search_threads and --format=3Draw doesn't need to or want to do that. But see, for example, recent notmuch-search.c and you'll see that depending on the --output option, the "notmuch search" command will sometimes call search_threads and will sometimes call search_messages. So I think we want the same thing here. Meanwhile, since this command is only acting on the first message matched, don't you think it should be documented as only working with a search term that matches a single message? Then it could simply print an error message if the terms matched multiple messages.[*] =2DCarl [*] And we'll want that same behavior for "notmuch part" as well. That's already implemented in notmuch-show.c and should also be implemented as a sub-option of "notmuch show" I think, (which is probably another outstanding patch for me to review). So there might be room for a little code-sharing there. =2D-=20 carl.d.worth@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQFM0wjE6JDdNq8qSWgRAjVBAJ4/esUuQcdwEhdWBaq3JqEOKcSlbQCfQX88 ve53lOI7bljWgKUTha0qygg= =IGwF -----END PGP SIGNATURE----- --=-=-=--