From 70f848010a2a5d5edbeaf5fe868ae06f7eb29265 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 25 Sep 2014 22:48:53 +0200 Subject: [PATCH] Re: [PATCH 1/5] cli: Refactor option passing in the search command --- 1b/ab379a8aef94e38fb242c498df9b56da9c1e60 | 115 ++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 1b/ab379a8aef94e38fb242c498df9b56da9c1e60 diff --git a/1b/ab379a8aef94e38fb242c498df9b56da9c1e60 b/1b/ab379a8aef94e38fb242c498df9b56da9c1e60 new file mode 100644 index 000000000..6d099afe5 --- /dev/null +++ b/1b/ab379a8aef94e38fb242c498df9b56da9c1e60 @@ -0,0 +1,115 @@ +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 EF6A1431FB6 + for ; Thu, 25 Sep 2014 13:49:15 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] 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 DAfOQHHqJzX9 for ; + Thu, 25 Sep 2014 13:49:10 -0700 (PDT) +Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) + by olra.theworths.org (Postfix) with ESMTP id C1785431FAF + for ; Thu, 25 Sep 2014 13:49:09 -0700 (PDT) +Received: from localhost (unknown [192.168.200.7]) + by max.feld.cvut.cz (Postfix) with ESMTP id 742863CFEB1; + Thu, 25 Sep 2014 22:49:02 +0200 (CEST) +X-Virus-Scanned: IMAP STYX AMAVIS +Received: from max.feld.cvut.cz ([192.168.200.1]) + by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new, + port 10044) + with ESMTP id cu5E41uJeuaM; Thu, 25 Sep 2014 22:48:58 +0200 (CEST) +Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) + by max.feld.cvut.cz (Postfix) with ESMTP id 96C533CFEA8; + Thu, 25 Sep 2014 22:48:58 +0200 (CEST) +Received: from wsh by steelpick.2x.cz with local (Exim 4.84) + (envelope-from ) + id 1XXFy9-0002Z6-2R; Thu, 25 Sep 2014 22:48:53 +0200 +From: Michal Sojka +To: Tomi Ollila , notmuch@notmuchmail.org +Subject: Re: [PATCH 1/5] cli: Refactor option passing in the search command +In-Reply-To: +References: <1411378679-7307-1-git-send-email-sojkam1@fel.cvut.cz> + <1411378679-7307-2-git-send-email-sojkam1@fel.cvut.cz> + +User-Agent: Notmuch/0.18.1+101~g56b0ff0 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Thu, 25 Sep 2014 22:48:53 +0200 +Message-ID: <87k34rtoi2.fsf@steelpick.2x.cz> +MIME-Version: 1.0 +Content-Type: text/plain +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, 25 Sep 2014 20:49:16 -0000 + +On Thu, Sep 25 2014, Tomi Ollila wrote: +> On Mon, Sep 22 2014, Michal Sojka wrote: +> +>> Many functions that implement the search command need to access command +>> line options. Instead of passing each option in a separate variable, put +>> them in a structure and pass only this structure. +> +> This patch looks good to me. + +Thanks for the review. + +> Although the test and the implementation in the next patches look OK, I'd +> prefer the FLAG implementation Jani suggested earlier. IMO now that I +> compare these two it looks cleaner and simpler... + +The question is which kind of simplicity you have in mind. I think that +my version is simpler to type (less keystrokes). But if others have +different opinion, I don't mind. + +> I.e. I'd prefer notmuch search --output=sender --output=recipients ... +> (same output regardless the order these options given). + +This should be the case with both implementations. + +> I'd postpone the unique handling to a bit later phase; there are quite a +> few options how to do that (*) +> +> +> Tomi +> +> (*) IMO the default unique (when requested) would be exact case-sensitive +> match of full name & address + +Why do you think that case-sensitive address matching should be the +default? In theory local-part can be case sensitive, but I've never seen +that in reality. So this default would only be useful if you want to +research how people type your email address :) + +> parts (phrase, address & comment); + +What do you mean by phrase and comment? Address syntax is defined by +http://tools.ietf.org/html/rfc5322#section-3.4.1. + +> then (a subset of possible) options could be: +> +) case-insensitive (first match taken (or last match?) -- option?) +> +) unique email addresses (take phrase/comment from first/last?) +> -- or use first that has something additional to plain address +> -- or use last that has something additional to plain address + +Yes, there is a lot of possible options. I don't think that notmuch has +to support all of them. If people need something special like "use last +that has something additional to plain address", they can always do +--unique=none and do their own post-processing. + +-Michal -- 2.26.2