From: David Bremner Date: Sat, 24 Mar 2012 18:58:43 +0000 (+2000) Subject: Re: [PATCH 1/3] cli: refactor "notmuch tag" data structures for tagging operations X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=0df69224d458433f31bc0328bf69d02d2854f6c1;p=notmuch-archives.git Re: [PATCH 1/3] cli: refactor "notmuch tag" data structures for tagging operations --- diff --git a/a5/238ce04f391683f3a3217cf604e41c3a2edd55 b/a5/238ce04f391683f3a3217cf604e41c3a2edd55 new file mode 100644 index 000000000..7ae8d6785 --- /dev/null +++ b/a5/238ce04f391683f3a3217cf604e41c3a2edd55 @@ -0,0 +1,74 @@ +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 9FE42431FAF + for ; Mon, 26 Mar 2012 11:43:39 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.485 +X-Spam-Level: +X-Spam-Status: No, score=0.485 tagged_above=-999 required=5 + tests=[DATE_IN_PAST_24_48=0.485] 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 NJSvXod0gAbc for ; + Mon, 26 Mar 2012 11:43:39 -0700 (PDT) +Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) + (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 06A1A431FAE + for ; Mon, 26 Mar 2012 11:43:38 -0700 (PDT) +Received: from tesseract.cs.unb.ca ([131.202.240.238] + helo=rocinante.cs.unb.ca) by tesseract.cs.unb.ca with esmtpsa + (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) + id 1SCEtE-0008R8-8o; Mon, 26 Mar 2012 15:43:37 -0300 +Received: from bremner by rocinante.cs.unb.ca with local (Exim 4.77) + (envelope-from ) + id 1SBWAl-00058I-Hu; Sat, 24 Mar 2012 14:58:43 -0400 +From: David Bremner +To: Jani Nikula , notmuch@notmuchmail.org +Subject: Re: [PATCH 1/3] cli: refactor "notmuch tag" data structures for + tagging operations +In-Reply-To: + <992ada5cb2fa5f89d4f38b10d62f1c178b3174e2.1332604895.git.jani@nikula.org> +References: + <992ada5cb2fa5f89d4f38b10d62f1c178b3174e2.1332604895.git.jani@nikula.org> +User-Agent: Notmuch/0.11.1+166~gd2ef4ed (http://notmuchmail.org) Emacs/23.3.1 + (x86_64-pc-linux-gnu) +Date: Sat, 24 Mar 2012 14:58:43 -0400 +Message-ID: <87pqc1ygf0.fsf@rocinante.cs.unb.ca> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Spam_bar: / +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: Mon, 26 Mar 2012 18:43:39 -0000 + +On Sat, 24 Mar 2012 18:14:35 +0200, Jani Nikula wrote: +> + if (argv[i][0] == '+' || argv[i][0] == '-') { +> + tag_ops[tag_ops_count++] = (tag_operation_t) { +> + .tag = argv[i] + 1, +> + .remove = argv[i][0] == '-', +> + }; + +I'm not sure if this is a worthwhile use of a C99. Wouldn't it be +simpler to just use two assignments? and maybe increment the index +after? Still 3 lines of code. + +Other than that, this patch looked ok to me. I think it probably +deserves a NEWS patch that the ordering behaviour changed. I do think +the new order is more sensible, and the old one was never documented. + + +d