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=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,URIBL_CSS, URIBL_CSS_A 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 B695C1F953 for ; Fri, 29 Oct 2021 21:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231546AbhJ2VhH (ORCPT ); Fri, 29 Oct 2021 17:37:07 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:52285 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbhJ2VhG (ORCPT ); Fri, 29 Oct 2021 17:37:06 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 8898D16B71B; Fri, 29 Oct 2021 17:34:37 -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; s=sasl; bh=5qJKUMMRLvZFUZnqxMdV2J/CNYwjDG1GVjtB5N YebfA=; b=MsbGJicIvGDp2S2NgfAKAdyyLf3u93+oHQoqy0btZdbITvgDuWnLk2 LF/H/Az1kqUiHLcFT6w448UYHIFOGzzPF6ETJr64DJDmNzBzT0rHNPUxrltIKFAf OaqW48vb60O8veWYm9u7NDbwsgGKdPRTL0w3MAG+WzzdTyaiwD8Y4= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 813E016B71A; Fri, 29 Oct 2021 17:34:37 -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 3BB6B16B718; Fri, 29 Oct 2021 17:34:34 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Eli Schwartz Cc: git@vger.kernel.org Subject: Re: [PATCH v3 1/3] pretty.c: rework describe options parsing for better extensibility References: <20211026013452.1372122-1-eschwartz@archlinux.org> <20211029184512.1568017-1-eschwartz@archlinux.org> <20211029184512.1568017-2-eschwartz@archlinux.org> Date: Fri, 29 Oct 2021 14:34:33 -0700 In-Reply-To: (Eli Schwartz's message of "Fri, 29 Oct 2021 17:06:56 -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: 02466D1E-3900-11EC-8C1B-F327CE9DA9D6-77302942!pb-smtp20.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Eli Schwartz writes: > On 10/29/21 4:11 PM, Junio C Hamano wrote: >> Eli Schwartz writes: >> >>> + struct { >>> + char *name; >>> + enum { OPT_STRING } type; >>> + } option[] = { >>> + { "exclude", OPT_STRING }, >>> + { "match", OPT_STRING }, >>> + }; >> >> I floated OPT_ in my earlier illustration as "something like >> this", not "literally use these tokens". We have CPP macros of the >> same name in parse-options.h API---we may not see troubles from the >> name clashes today, but let's not leave it to chances. >> >> Perhaps call it like DESCRBE_ARG_STRING or something that ensures >> uniqueness like that? > > > Ah. That alternative seems a bit long though. :( Without breaking enum > type into one per line, it will quickly overflow line lengths... though > maybe it should be one per line anyway? Yes, these things should be one item per line; a patch that adds or removes one would become easier to read. > > Will try to put some thought into naming.