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.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,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 657DF1F670 for ; Sat, 23 Oct 2021 22:26:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231331AbhJWW20 (ORCPT ); Sat, 23 Oct 2021 18:28:26 -0400 Received: from pb-smtp21.pobox.com ([173.228.157.53]:65197 "EHLO pb-smtp21.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229730AbhJWW2Z (ORCPT ); Sat, 23 Oct 2021 18:28:25 -0400 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 22EA815D3C8; Sat, 23 Oct 2021 18:26:06 -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=IMM2vRj/3MFJ 5ggXDoHbtQvf03owcXqdKs4ZIaQI5ss=; b=j/234N0MnxEy13CL40H6Sfh+9ZDW XyoEOlSsD3yeAT3VREju5rCxBbsjQaSftZSOWb8jxFuGUODT+yOUGg93Xb1ds5q2 YNIXQEfTOeY3qgorclvd/rDJWNvJfIKgjVlqvuuVdvXj0h+u21kFZhz7/i+mACYz eVKDs3syyVPvKPE= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 1B7AC15D3C7; Sat, 23 Oct 2021 18:26:06 -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-smtp21.pobox.com (Postfix) with ESMTPSA id 7A7A315D3C5; Sat, 23 Oct 2021 18:26:03 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org, Jeff King , Johannes Sixt , =?utf-8?Q?=C3=98ystein?= Walle , Eric Sunshine , Taylor Blau Subject: Re: [PATCH v2 10/10] generate-cmdlist.sh: replace "cut", "tr" and "grep" with pure-shell References: Date: Sat, 23 Oct 2021 15:26:02 -0700 In-Reply-To: (=?utf-8?B?IsOGdmFyIEFybmZqw7Zyw7A=?= Bjarmason"'s message of "Fri, 22 Oct 2021 21:36:14 +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: 35232678-3450-11EC-9CFC-98D80D944F46-77302942!pb-smtp21.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: > Extend the pure-shell parsing of command-list.txt by using having using having??? > command_list() take an argument indicating whether we're interested in > the "$cmd" part of the line, or just the "$rest". OK, --no-cat stands for --no-category? Even if (or especially if, perhaps) you do not bother to parse the option in the command_list helper, it would help the readers if it is spelled out. I somehow thought if this option has anything to do with "/bin/cat". > That takes care of the "cut -d", and printf's auto-repeat feature can > replace the "tr". We don't need the "grep -v" either, as we're not > emitting any empty lines here (the command-list.txt doesn't have any). It may make sense to ensure that the case arm won't feed an empty=20 line that made cmd an empty by tightening the condition. case "$cmd" in "#"*) continue ;;=20 - *) + ?*) case "$exclude_programs" in *:"$cmd":*) ;; If anything, that would serve as a clear documentation that we are safe even when the input has an empty line.