Re: [PATCH] cli: notmuch search --duplicate=N is only supported with --output=files
authorDavid Edmondson <dme@dme.org>
Thu, 30 Oct 2014 08:19:53 +0000 (08:19 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:05:52 +0000 (10:05 -0800)
23/6f639328ad003fd8f7e71cca2dba1d2f9a1166 [new file with mode: 0644]

diff --git a/23/6f639328ad003fd8f7e71cca2dba1d2f9a1166 b/23/6f639328ad003fd8f7e71cca2dba1d2f9a1166
new file mode 100644 (file)
index 0000000..cfe7dca
--- /dev/null
@@ -0,0 +1,106 @@
+Return-Path: <dme@dme.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 D9F81431FC7\r
+       for <notmuch@notmuchmail.org>; Thu, 30 Oct 2014 01:20:02 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.699\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7, UNPARSEABLE_RELAY=0.001]\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 TlsvqjIrk1OB for <notmuch@notmuchmail.org>;\r
+       Thu, 30 Oct 2014 01:19:58 -0700 (PDT)\r
+Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com\r
+ [74.125.82.42])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ E7D50431FB6   for <notmuch@notmuchmail.org>; Thu, 30 Oct 2014 01:19:57 -0700\r
+ (PDT)\r
+Received: by mail-wg0-f42.google.com with SMTP id k14so5042381wgh.1\r
+       for <notmuch@notmuchmail.org>; Thu, 30 Oct 2014 01:19:55 -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:to:cc:subject:in-reply-to:references:user-agent\r
+       :from:date:message-id:mime-version:content-type;\r
+       bh=HUqr1yqiBnfc7yjaToIUpRgA2mV2xWBn6da+R2mpJNk=;\r
+       b=ieoOO5W23sOnmTDO9AV1bAl3dPO/D+vEBf2klY9GLDLXT/UDK3b1wRRGgJGbYOXCl5\r
+       A1OHV5Q7rEVWVhU5rXX3Q0mwoIWa3E/vlhJsaGWOruP4GE4/EleL7xwQkBcfXKI70Kyi\r
+       0FVcupLWmDrl9AT5hYpL3brFNlreNTNhnpHMHwPScvFoFvZKnNx3W7JOMN9LVUmMpvgF\r
+       YsdIMNlOITBqZyuyRYQAvn4ycd1qJ2f32pImVGX2PYS/SovzwNXMA75fQAcbYGxpNXie\r
+       o3SVZWzBYtfb0u/e28NjuX59X9NbxCdLpGC3p6zdRHzuFbfZ5hlnSnr97jzsx5TPuefL\r
+       CfQg==\r
+X-Gm-Message-State:\r
+ ALoCoQn70u0XxPsO0bgL5MD9ONztI3p2ZAw7h74cgzCpbI0aEYXtaZ55qaZJ2NcMtCFQ/EHcOoJn\r
+X-Received: by 10.194.216.162 with SMTP id or2mr18332831wjc.68.1414657195578; \r
+       Thu, 30 Oct 2014 01:19:55 -0700 (PDT)\r
+Received: from disaster-area.hh.sledj.net\r
+       ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])\r
+       by mx.google.com with ESMTPSA id\r
+       bv17sm21346014wib.13.2014.10.30.01.19.54 for <multiple recipients>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Thu, 30 Oct 2014 01:19:54 -0700 (PDT)\r
+Received: from localhost (30000@localhost [local]);\r
+       by localhost (OpenSMTPD) with ESMTPA id e5f5b7d4;\r
+       Thu, 30 Oct 2014 08:19:52 +0000 (UTC)\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] cli: notmuch search --duplicate=N is only supported with\r
+       --output=files\r
+In-Reply-To: <1414611043-3498-1-git-send-email-jani@nikula.org>\r
+References: <cunr3xqolg8.fsf@gargravarr.hh.sledj.net>\r
+       <1414611043-3498-1-git-send-email-jani@nikula.org>\r
+User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.1\r
+       (x86_64-apple-darwin14.0.0)\r
+From: David Edmondson <dme@dme.org>\r
+Date: Thu, 30 Oct 2014 08:19:53 +0000\r
+Message-ID: <m28ujy6kba.fsf@dme.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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, 30 Oct 2014 08:20:03 -0000\r
+\r
+This works, in so much as it doesn't allow the deranged behaviour.\r
+\r
+Consequentially, --duplicate seems a bit useless. Unless I feed it a\r
+single id: as an argument (in which case I could use --output=files), I\r
+have to figure out which of the files output are duplicates of each\r
+other and which are from different messages. How is that useful?\r
+\r
+On Wed, Oct 29 2014, Jani Nikula wrote:\r
+> Check the supported combination, and bail out for other combinations.\r
+> ---\r
+>  notmuch-search.c | 5 +++++\r
+>  1 file changed, 5 insertions(+)\r
+>\r
+> diff --git a/notmuch-search.c b/notmuch-search.c\r
+> index bc9be4593ecc..3bb5a7fbc885 100644\r
+> --- a/notmuch-search.c\r
+> +++ b/notmuch-search.c\r
+> @@ -387,6 +387,11 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
+>      if (opt_index < 0)\r
+>      return EXIT_FAILURE;\r
+>  \r
+> +    if (output != OUTPUT_FILES && dupe != -1) {\r
+> +    fprintf (stderr, "Error: --duplicate=N is only supported with --output=files.\n");\r
+> +    return EXIT_FAILURE;\r
+> +    }\r
+> +\r
+>      switch (format_sel) {\r
+>      case NOTMUCH_FORMAT_TEXT:\r
+>      format = sprinter_text_create (config, stdout);\r
+> -- \r
+> 2.1.1\r