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-ASN: AS53758 23.128.96.0/24 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,RCVD_IN_DNSWL_HI,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 96A2B1F4B4 for ; Sat, 10 Apr 2021 01:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232855AbhDJBoK (ORCPT ); Fri, 9 Apr 2021 21:44:10 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:56638 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbhDJBoK (ORCPT ); Fri, 9 Apr 2021 21:44:10 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id E5311BE781; Fri, 9 Apr 2021 21:43:55 -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=JxCXLRDvADK5x7Fj77ZwkdJaOPs=; b=LDeJhO 4dFHxF0QdO9YzBF8Ti8QF9B1az+668aBHImQG9Tbs4XChxqb5XINnFzFpHHK+N3z LV1qz0ZFz/WXeJbKpAtnlDAdvRuLFNlgEnbkOVOo5rT1AmHp68wdp5xSnRr53Wdq 4tJQ1yg/QBJJNOyVzJ9W8uCt7WJTMADcnre7M= 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=VvyYs+uYyzWX4sJFrHgFFqzzMKdjRX6q vnQGea6WG5ggXHF47dNLgt5A0r7/CwHv+HMNzFB6jvgYFzd4KIDQoGGnOKFHtYUj z6vELirOHnqW3hIAXvaBlkNinbVTIUVGWD8k4rWBm59iYn9c6cWOusCOcWD4hbpu VrSNbH0lO1o= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id DC6E9BE77F; Fri, 9 Apr 2021 21:43:55 -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 6E3B6BE77D; Fri, 9 Apr 2021 21:43:55 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Jeff King Cc: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , git@vger.kernel.org, Lin Sun , =?utf-8?B?xJBvw6BuIFRy4bqnbiBDw7RuZw==?= Danh , David Aguilar Subject: Re: [PATCH 4/5] config.c: add a "tristate" helper References: Date: Fri, 09 Apr 2021 18:43:54 -0700 In-Reply-To: (Jeff King's message of "Fri, 9 Apr 2021 21:23:16 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 35FED8B4-999E-11EB-BA89-D152C8D8090B-77302942!pb-smtp1.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Jeff King writes: > So a function like: > > int git_parse_tristate(const char *value, int *out); > > which returned success/error via its return value, and put the value > into "out" would feel pretty natural to me. Yeah, with s/tristate/bool-or-auto/, and if we do this throughout the types, that would be ideal. FWIW git_parse_ulong() and friends for sized numerics already follow that pattern, but helpers for boolean like git_parse_maybe_bool() don't, which is unfortunate.