[RFC PATCH 0/2] cli: split 'notmuch address' from 'notmuch search'
authorJani Nikula <jani@nikula.org>
Sat, 1 Nov 2014 11:30:46 +0000 (13:30 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:06:02 +0000 (10:06 -0800)
94/5f4ddc7d59fb54a421de1619ad4ef1f70814a0 [new file with mode: 0644]

diff --git a/94/5f4ddc7d59fb54a421de1619ad4ef1f70814a0 b/94/5f4ddc7d59fb54a421de1619ad4ef1f70814a0
new file mode 100644 (file)
index 0000000..800bd2c
--- /dev/null
@@ -0,0 +1,124 @@
+Return-Path: <jani@nikula.org>\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 33450431FD2\r
+       for <notmuch@notmuchmail.org>; Sat,  1 Nov 2014 04:30:57 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 0bykIjZrjRNr for <notmuch@notmuchmail.org>;\r
+       Sat,  1 Nov 2014 04:30:53 -0700 (PDT)\r
+Received: from mail-la0-f44.google.com (mail-la0-f44.google.com\r
+       [209.85.215.44]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id A63B6431FAF\r
+       for <notmuch@notmuchmail.org>; Sat,  1 Nov 2014 04:30:52 -0700 (PDT)\r
+Received: by mail-la0-f44.google.com with SMTP id gf13so7518393lab.3\r
+       for <notmuch@notmuchmail.org>; Sat, 01 Nov 2014 04:30:50 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+       :references;\r
+       bh=zZsqh5Nz8uol2/SuV1QivkDVHs8L+uZNjvI0FdMbWyg=;\r
+       b=NZEuDYpawmG1ATP0jXp1bymr7i339m8jHR8k68QctihNVQi0LTNkZfjmRa4GzundtF\r
+       K8A8+CFlJTOc7ai+CNJrpENw+IIPoRk+vsWSzXxlWgywe8Zw+SJvUP1EVHsCpBTrYLfY\r
+       PyOpQzIMITq1FFbDuDHP1Ue0hX7zabT4C3YdHNSBcfevaUgTONPJSc6ph2DUYcQSs1D5\r
+       14eAQ4mO+2T4CmeqiV+gHEXezHQSkw+a/E8Qt8nXg/AXXb5hLLEW6muOBCGzsyguMLz/\r
+       16G6ZXQFyRPqnJzKMXsDyLdhOaz8ElrycmEsNxzIaKVJcc2h68FnjZAVwYZ/tEpZkXqR\r
+       lveA==\r
+X-Gm-Message-State:\r
+ ALoCoQk7RwTgB1PXElx+Sr6SDrgCUEca4GijUL2WTDDWwyMkVkYSkuiTxkB+pG2wM1drlVBdbgdP\r
+X-Received: by 10.113.5.7 with SMTP id ci7mr33664147lbd.9.1414841450887;\r
+       Sat, 01 Nov 2014 04:30:50 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c36d-48.dhcp.inet.fi.\r
+       [88.195.109.48])\r
+       by mx.google.com with ESMTPSA id g5sm5528456lam.1.2014.11.01.04.30.49\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Sat, 01 Nov 2014 04:30:50 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Michal Sojka <sojkam1@fel.cvut.cz>\r
+Subject: [RFC PATCH 0/2] cli: split 'notmuch address' from 'notmuch search'\r
+Date: Sat,  1 Nov 2014 13:30:46 +0200\r
+Message-Id: <cover.1414839970.git.jani@nikula.org>\r
+X-Mailer: git-send-email 2.1.1\r
+In-Reply-To: <87egtn2s4z.fsf@steelpick.2x.cz>\r
+References: <87egtn2s4z.fsf@steelpick.2x.cz>\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: Sat, 01 Nov 2014 11:30:57 -0000\r
+\r
+On Sat, 01 Nov 2014, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
+> On Sat, Nov 01 2014, Jani Nikula wrote:\r
+>> On Fri, 31 Oct 2014, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
+>>> This option allows to configure the criterion for duplicate address\r
+>>> filtering. Without this option, all unique combinations of name and\r
+>>> address parts are printed. This option allows to filter the output\r
+>>> more, for example to only contain unique address parts.\r
+>>\r
+>> This patch finally makes me think we should have a separate 'notmuch\r
+>> address' command for all of this. We are starting to have two orthogonal\r
+>> sets of 'notmuch search' options, one set for search and another for\r
+>> addresses. I regret not following the series and then making the\r
+>> observation so late.\r
+>\r
+> To some extent it is true. The question is whether it would make sense\r
+> for 'notmuch address' to have options like --offset and --limit.\r
+> Probably not.\r
+>\r
+> I can prepare a new patchset implementing 'notmuch address' over the\r
+> weekend. It would be necessary to revert the last (or two) already\r
+> merged patch. What do others think?\r
+\r
+Here's a couple of draft patches to make the search/address command\r
+split happen with minimal changes.\r
+\r
+In my opinion the problem is primarily in the user interface;\r
+notmuch-search man page is growing intimidating to the user. I also\r
+think splitting the implementation completely would lead to too much\r
+code duplication, as there is plenty of common code. The idea here is to\r
+split the user interface for address searching now when we haven't made\r
+a release with the functionality, and we can more easily change the code\r
+behind the interface going forward. Plus we can more comfortably add\r
+address management commands to 'notmuch address' than 'notmuch search'\r
+as the need arises.\r
+\r
+I do have to say in the end I'm also fine with having everything in the\r
+notmuch search command if there's opposition to having two very similar,\r
+even if diverging, commands.\r
+\r
+BR,\r
+Jani.\r
+\r
+\r
+Jani Nikula (2):\r
+  cli: add support for hierarchical command line option arrays\r
+  cli: add notmuch address command\r
+\r
+ command-line-arguments.c |  11 ++--\r
+ command-line-arguments.h |   1 +\r
+ notmuch-client.h         |   3 ++\r
+ notmuch-search.c         | 128 ++++++++++++++++++++++++++++++-----------------\r
+ notmuch.c                |   2 +\r
+ 5 files changed, 95 insertions(+), 50 deletions(-)\r
+\r
+-- \r
+2.1.1\r
+\r