From 5587a249a4f7cd890e8dbd1391874520b9b0b440 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 22 Jun 2013 07:52:02 +0100 Subject: [PATCH] Re: [PATCH v6 02/12] tag-util: do not reset list in parse_tag_command_line --- 32/382f2802b2bcac2a8e9f850243390f971cdec0 | 124 ++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 32/382f2802b2bcac2a8e9f850243390f971cdec0 diff --git a/32/382f2802b2bcac2a8e9f850243390f971cdec0 b/32/382f2802b2bcac2a8e9f850243390f971cdec0 new file mode 100644 index 000000000..530ffbd02 --- /dev/null +++ b/32/382f2802b2bcac2a8e9f850243390f971cdec0 @@ -0,0 +1,124 @@ +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 081D5431FB6 + for ; Fri, 21 Jun 2013 23:52:16 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, 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 MgaPYYuWx9tB for ; + Fri, 21 Jun 2013 23:52:08 -0700 (PDT) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 0B04D431FAE + for ; Fri, 21 Jun 2013 23:52:08 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1UqHg5-000162-Hl; Sat, 22 Jun 2013 07:52:06 +0100 +Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1UqHg5-0008Sb-8s; Sat, 22 Jun 2013 07:52:05 +0100 +From: Mark Walters +To: Peter Wang , notmuch@notmuchmail.org +Subject: Re: [PATCH v6 02/12] tag-util: do not reset list in + parse_tag_command_line +In-Reply-To: <1371880008-18312-3-git-send-email-novalazy@gmail.com> +References: <1371880008-18312-1-git-send-email-novalazy@gmail.com> + <1371880008-18312-3-git-send-email-novalazy@gmail.com> +User-Agent: Notmuch/0.15.2+171~ge2f30a2 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Sat, 22 Jun 2013 07:52:02 +0100 +Message-ID: <87mwqivdrh.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 93.97.24.31 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: fbab1e3826fac83e5935b15cb239dec2 (of first 20000 bytes) +X-SpamAssassin-Score: -0.0 +X-SpamAssassin-SpamBar: / +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -0.0 points. + Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * -0.0 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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: Sat, 22 Jun 2013 06:52:16 -0000 + + + +> No current callers of parse_tag_command_line require that it clear its +> tag list argument. The notmuch 'insert' command will be better served +> if the function modifies a pre-populated list (of new.tags) instead of +> clobbering it outright. + +As far as I can see there is now only 1 caller of +parse_tag_command_line. Assuming I am correct can we make this "As the +unique current caller of parse_tag_command_line does not require..." + +Best wishes + +Mark + +> --- +> tag-util.c | 2 -- +> tag-util.h | 2 ++ +> 2 files changed, 2 insertions(+), 2 deletions(-) +> +> diff --git a/tag-util.c b/tag-util.c +> index 92e08a1..3bde409 100644 +> --- a/tag-util.c +> +++ b/tag-util.c +> @@ -165,8 +165,6 @@ parse_tag_command_line (void *ctx, int argc, char **argv, +> +> int i; +> +> - tag_op_list_reset (tag_ops); +> - +> for (i = 0; i < argc; i++) { +> if (strcmp (argv[i], "--") == 0) { +> i++; +> diff --git a/tag-util.h b/tag-util.h +> index 246de85..4628f16 100644 +> --- a/tag-util.h +> +++ b/tag-util.h +> @@ -81,6 +81,8 @@ parse_tag_line (void *ctx, char *line, +> * Output Parameters: +> * ops contains a list of tag operations +> * query_str the search terms. +> + * +> + * The ops argument is not cleared. +> */ +> +> tag_parse_status_t +> -- +> 1.7.12.1 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2