From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 800BE1F71B for ; Tue, 2 Aug 2016 17:09:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935581AbcHBRI2 (ORCPT ); Tue, 2 Aug 2016 13:08:28 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:64211 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933057AbcHBRIP (ORCPT ); Tue, 2 Aug 2016 13:08:15 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id E9712329A2; Tue, 2 Aug 2016 13:08:13 -0400 (EDT) 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=gtSAZ2cS5BbLjJgqqy/4eiXXlJI=; b=eeVIyi zUyYFueLel3vCoeuHD6Ow6cGkaf63r0XRFUIchWrDyNpZKCDpcsr/EgdDNOwU/O7 aoCJFNZ62+PAbLsvRiI8TYVsCe/rlvzoQ40DZ4yrUCA34Fx2yAipIKZWBgYgsaJS fgq1hHji2CixJBfqF3VwBo5q34sRXBoThUGoc= 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=MOISTfXRQrd2/MxbRscRLlhmtriqAmVD ZfHaJiTlHXxANK70mSPeLD5L59nWOXkmd/E6feWWSt6kzItfEtmitTU6oZQ6GNVk aLwQRtOGaffcYBN5vrcvQwWUDLYrWlUURxIVcKCr0yxsYZ3Vxhbtdy3EbUrHs1We oE0S8LxAIxU= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id E1E30329A1; Tue, 2 Aug 2016 13:08:13 -0400 (EDT) Received: from pobox.com (unknown [104.132.0.95]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 6F5143299F; Tue, 2 Aug 2016 13:08:13 -0400 (EDT) From: Junio C Hamano To: Johannes Schindelin Cc: Kevin Willford , git@vger.kernel.org, Kevin Willford Subject: Re: [[PATCH v2] 4/4] rebase: avoid computing unnecessary patch IDs References: <20160729161920.3792-1-kcwillford@gmail.com> <20160729161920.3792-5-kcwillford@gmail.com> Date: Tue, 02 Aug 2016 10:08:11 -0700 In-Reply-To: (Johannes Schindelin's message of "Tue, 2 Aug 2016 12:45:17 +0200 (CEST)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: B25546E8-58D3-11E6-A1EF-89D312518317-77302942!pb-smtp1.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Johannes Schindelin writes: >> Perhaps hashmap API needs fixing in the longer term not to call this >> type hashmap_cmp_fn; instead it should lose cmp and say something >> like hashmap_eq_fn or something. > > Maybe. > > But to make sure: you do not expect Kevin to do that in the context of > this here patch series, right? I think I already answered this in the message you are responding to. > Do you want a note in the commit message about this "abuse" of a negative > return value, or a code comment? I do not think negative (or non-zero) return is an "abuse" at all. It is misleading in the context of the function whose name has "cmp" in it, but that is not the fault of this function, rather, the breakage is more in the API that calls a function that wants to know only equality a "cmp". A in-code comment before the function name may be appropriate: /* * hashmap API calls hashmap_cmp_fn, but it only wants * "does the key match the entry?" with 0 (matches) and * non-zero (does not match). */ static int patch_id_match(const struct patch_id *ent, const struct patch_id *key, const void *keydata) { ...