From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87FFCC433EF for ; Wed, 29 Sep 2021 00:51:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F237613CF for ; Wed, 29 Sep 2021 00:51:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243496AbhI2Awn (ORCPT ); Tue, 28 Sep 2021 20:52:43 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:59210 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242614AbhI2Awm (ORCPT ); Tue, 28 Sep 2021 20:52:42 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id A6E5D14C809; Tue, 28 Sep 2021 20:51:02 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=9DtWEmHoIVvb 3AmxpOE145LbP/lnr1cmc9JTJ4YAjB0=; b=vuXohIpuCAqE3NnmFyHcLzKOW04/ nkqIQY7v4pLO+5K0NtaJrr0w/JCnY3U+ONuQDq7w/IkXKTdrxxjB7USfVT+UBv36 NwR/UK5kujRykE95aEJyJbqdqmVGwDw3xf8dfs3eqprCvHeoRo21ncI+PphyGXkt Sv2Ej9612Dl1EFY= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 9FBB114C808; Tue, 28 Sep 2021 20:51:02 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [104.133.2.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id F0CAD14C805; Tue, 28 Sep 2021 20:50:59 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org, Jeff King , Thomas Rast , =?utf-8?Q?Ren=C3=A9?= Scharfe Subject: Re: [PATCH 10/10] parse-options: change OPT_{SHORT,UNSET} to an enum References: Date: Tue, 28 Sep 2021 17:50:58 -0700 In-Reply-To: (=?utf-8?B?IsOGdmFyIEFybmZqw7Zyw7A=?= Bjarmason"'s message of "Tue, 28 Sep 2021 15:14:31 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: 5051AE14-20BF-11EC-A0F5-F327CE9DA9D6-77302942!pb-smtp20.pobox.com Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason writes: > Change the comparisons against OPT_SHORT and OPT_UNSET to an enum > which keeps track of how a given option got parsed. The case of "0" > was an implicit OPT_LONG, so let's add an explicit label for it. I think this is going backwards. If we want to change anything in this area, you may (1) spell the values not as 1 and 2 but as bit-shifts (1U<<0), (1U<<1), and (2) turn "flags" into "unsigned". but I do not think of a reason why it would be a good move to use enum for "these are bits", for the same reason as my comments on [2/10]. Thanks.