From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 03DA21F4B4 for ; Sun, 27 Sep 2020 21:18:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726335AbgI0VSO (ORCPT ); Sun, 27 Sep 2020 17:18:14 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:50216 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbgI0VSO (ORCPT ); Sun, 27 Sep 2020 17:18:14 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id DCC836A441; Sun, 27 Sep 2020 17:18:11 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=ZvDcwnC3Tu7qeKYcaxfZK84MW6M=; b=KdGvcN IfWuVFkvBBJnKrHi+FEj+j9N4Wt0ZfmB0nkhH6oVhHMq+gRBVNZHTCxSJvS4zIkK R8mwmbYlBRqG7btOu14CaKLJB2cNnOs6OyF31dFXCQBDXfZ0kSGVLH60gt1Jjup/ 9zgeJ9oLgE3oHKhvV6ZD6bw1cDun6DYKUrsvk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=pDjdSnMPPhZvGOKwQvXNGKjaKkqHaQZS bsWrKsupNM3k766ebkenKsDFSP94EuiYLzx8am6c1OqT2U2lfoLtZk5GcKzaKXLR tic8R8bHcgB4viDnVUlG0zIAKoSbRgQIDy7OVa3nEq18/s/tzQOX6xuml2KtE8TL Ly3RcSP2yKU= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id D2C596A440; Sun, 27 Sep 2020 17:18:11 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 5EE576A43F; Sun, 27 Sep 2020 17:18:11 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Jeff King Cc: git@vger.kernel.org, Eric Sunshine , Martin =?utf-8?Q?=C3=85gren?= Subject: Re: [PATCH v2 8/8] shortlog: allow multiple groups to be specified References: <20200927083933.GA2222823@coredump.intra.peff.net> <20200927084015.GH2465761@coredump.intra.peff.net> Date: Sun, 27 Sep 2020 14:18:10 -0700 In-Reply-To: <20200927084015.GH2465761@coredump.intra.peff.net> (Jeff King's message of "Sun, 27 Sep 2020 04:40:15 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: F27403BA-0106-11EB-8C51-01D9BED8090B-77302942!pb-smtp1.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Jeff King writes: > - if (strcasecmp(iter.key.buf, log->trailer)) > + if (!string_list_has_string(&log->trailers, iter.key.buf)) > continue; ... > + if (!log.groups) > + log.groups = SHORTLOG_GROUP_AUTHOR; > + string_list_sort(&log.trailers); I initially reacted with "oh, why sort?" to this line, before realizing that the list is used as a look-up table, which, if I recall correctly, you said you want to see us move off of in the longer term. As we already have the string-set in this series, I am wondering why we are not using it. It's not like the code at some point needs to iterate over log.trailers in some stable order, right? I do realize that going to hashmap might be overkill, but once we have an easy-to-use wrapper around it, between one "table of strings" API and another "table of strings" API, I do not see a reason why we want to choose the string_list. Thanks.