From: Michal Sojka Date: Tue, 4 Nov 2014 11:36:09 +0000 (+0100) Subject: Re: [PATCH v2 08/10] cli: address: Do not output duplicate addresses X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2f97f9773ad30da658767ab7e647c5c3211759cc;p=notmuch-archives.git Re: [PATCH v2 08/10] cli: address: Do not output duplicate addresses --- diff --git a/34/91603e61810ecd6ad9f359ff171c7ebf7aad86 b/34/91603e61810ecd6ad9f359ff171c7ebf7aad86 new file mode 100644 index 000000000..6b517e9bf --- /dev/null +++ b/34/91603e61810ecd6ad9f359ff171c7ebf7aad86 @@ -0,0 +1,130 @@ +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 8DBCD431FCF + for ; Tue, 4 Nov 2014 12:45:37 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.224 +X-Spam-Level: +X-Spam-Status: No, score=-1.224 tagged_above=-999 required=5 + tests=[DATE_IN_PAST_03_06=1.076, 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 RxU85UFhStSJ for ; + Tue, 4 Nov 2014 12:45:30 -0800 (PST) +Received: from relay.felk.cvut.cz (relay.felk.cvut.cz [147.32.80.7]) + by olra.theworths.org (Postfix) with ESMTP id CBC76431FAE + for ; Tue, 4 Nov 2014 12:45:29 -0800 (PST) +Received: from control.felk.cvut.cz (control.felk.cvut.cz [147.32.87.4]) + by relay.felk.cvut.cz (8.14.9/8.14.9) with ESMTP id sA4FZxMl036846; + Tue, 4 Nov 2014 16:35:59 +0100 (CET) (envelope-from sojka@merica.cz) +Received: from CONTROL/SpoolDir by control.felk.cvut.cz (Mercury 1.48); + 4 Nov 14 16:36:00 +0100 +Received: from SpoolDir by CONTROL (Mercury 1.48); 4 Nov 14 16:35:54 +0100 +Received: from rtime.felk.cvut.cz (147.32.86.92) by control.felk.cvut.cz + (Mercury 1.48) with ESMTP; 4 Nov 14 16:35:53 +0100 +Received: from localhost ([127.0.0.1] helo=steelpick.2x.cz) + by rtime.felk.cvut.cz with esmtp (Exim 4.80) + (envelope-from ) + id 1Xlg9A-0004xP-Hk; Tue, 04 Nov 2014 16:35:52 +0100 +Received: from wsh by steelpick.2x.cz with local (Exim 4.84) + (envelope-from ) + id 1XlcPB-0002Wr-G1; Tue, 04 Nov 2014 12:36:09 +0100 +From: Michal Sojka +To: David Bremner , notmuch@notmuchmail.org +Subject: Re: [PATCH v2 08/10] cli: address: Do not output duplicate addresses +In-Reply-To: <87a947monn.fsf@maritornes.cs.unb.ca> +References: <1415058622-21162-1-git-send-email-sojkam1@fel.cvut.cz> + <1415058622-21162-9-git-send-email-sojkam1@fel.cvut.cz> + <87a947monn.fsf@maritornes.cs.unb.ca> +User-Agent: Notmuch/0.18.2+157~ga00d359 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Tue, 04 Nov 2014 12:36:09 +0100 +Message-ID: <87a947mc46.fsf@steelpick.2x.cz> +MIME-Version: 1.0 +Content-Type: text/plain +X-FELK-MailScanner-Information: +X-MailScanner-ID: sA4FZxMl036846 +X-FELK-MailScanner: Found to be clean +X-FELK-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, + score=1.093, required 6, BAYES_00 -0.50, DATE_IN_PAST_03_06 1.59, + HEADER_FROM_DIFFERENT_DOMAINS 0.00) +X-FELK-MailScanner-SpamScore: s +X-FELK-MailScanner-From: sojka@merica.cz +X-FELK-MailScanner-Watermark: 1415720167.12737@Y0Rgo6YZHp5B4GF9H3aRWg +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: Tue, 04 Nov 2014 20:45:38 -0000 + +On Tue, Nov 04 2014, David Bremner wrote: +> Michal Sojka writes: +> +>> +>> +/* Returns TRUE iff name and addr is duplicate. */ +> +> If you're revising this patch, it would be good to mention the side +> effect of this function. +> +>> -process_address_list (const search_context_t *ctx, InternetAddressList *list) +>> +process_address_list (const search_context_t *ctx, +>> + InternetAddressList *list) +> +> It probably doesn't make any difference, but this looks like a needless +> whitespace change. +> +> This function definitely needs some comment / pointer to +> documention. And probably not to have _my in the name. +> +>> +static void +>> +_my_talloc_free_for_g_hash (void *ptr) +>> +{ +>> + talloc_free (ptr); +>> +} +>> + +> +> I don't understand the name of the next subtest +> +>> +test_begin_subtest "No --output" +>> +notmuch address --output=sender --output=recipients '*' >OUTPUT + +This should be "notmuch address '*' >OUTPUT". I'll fix that. + +>> +# Use EXPECTED from previous subtest +>> +test_expect_equal_file OUTPUT EXPECTED +>> + +>> + +>> +test_done +> +> nitpick, extra blank lines +> +> So, AIUI, this is all of the series proposed for 0.19. + +Agreed. + +> It looks close to OK to me, modulo some minor style nits. One +> anonymous commentator on IRC mentioned the use of module scope +> variables, I guess in patch 6/10. I'm not sure of a better solution, +> but it's true in a perfect world we wouldn't have module local state. + +A possible solution would be fill in common_options structure +programmatically, but this would make the code much less readable. I can +think of a few other solutions but none of them would fit into "perfect +world" :) + +I'll send updated patches in the evening (CET timezone). + +Thanks +-Michal