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 X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C1BFC432BE for ; Thu, 26 Aug 2021 19:21:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 425EA60F58 for ; Thu, 26 Aug 2021 19:21:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233147AbhHZTWM (ORCPT ); Thu, 26 Aug 2021 15:22:12 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:64881 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230024AbhHZTWL (ORCPT ); Thu, 26 Aug 2021 15:22:11 -0400 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id B6B4AE6B8A; Thu, 26 Aug 2021 15:21:20 -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=RT7w+j6VtU+uk1+xcaXAALvjLZti3i0URt4Yma EtQ4A=; b=RuEBA94bqm8GXntSB14a3gTLffh6Cgat01A9eht91r9vjrOwJJ411B 3DhyTZ8wuVXZL7fMngAByarndPKXGQ1ol2aBE/nqnVeHmSE0L5CQ3glCOkPIy49Z +KalVczhtQGyrjMIHBwVkx4UlCtyDEJyVDvr5FNBfpm6IMvoEDDTk= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id AED2EE6B89; Thu, 26 Aug 2021 15:21:20 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.116.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 36DE5E6B87; Thu, 26 Aug 2021 15:21:20 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Carlo Arenas Cc: Taylor Blau , git@vger.kernel.org, Jens.Lehmann@web.de Subject: Re: [PATCH] test-lib-functions: avoid non POSIX ERE in test_dir_is_empty() References: <20210826031710.32980-1-carenas@gmail.com> Date: Thu, 26 Aug 2021 12:21:19 -0700 In-Reply-To: (Carlo Arenas's message of "Wed, 25 Aug 2021 23:28:40 -0700") 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: CB0876CE-06A2-11EC-9027-ECFD1DBA3BAF-77302942!pb-smtp2.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Carlo Arenas writes: > egrep (and also fgrep, which we intentionally support because it is > missing from some ancient AIX system[1]) will be removed in the > next[2] release of GNU grep. It is not a reason not to nudge us to prepare for the eventual removal of these two commands, but we need to keep the facts straight in our log messages. The way I read [2], they will only start giving a warning message nudging the users to use "grep -[EF]", and for them to be able to warn, I would imagine they have to stay in the release without getting removed. > [1] 87539416fd (tests: grep portability fixes, 2008-09-30) > [2] https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1 There are about 35 places in t/ we call egrep or fgrep; if we can add a pair of replacement shell functions in t/test-lib.sh for them to use whatever command GIT_TEST_EGREP and GIT_TEST_FGREP environment variables specify and fall back on "grep -E/-F" otherwise, we can prepare for the change without too much code churning. Something along the lines of # in test-lib-functions.sh : ${GIT_TEST_EGREP:=grep -E} ${GIT_TEST_FGREP:=grep -F} egrep () { $GIT_TEST_EGREP "$@" } fgrep () { $GIT_TEST_FGREP "$@" } where people could do something silly like GIT_TEST_FGREP='command fgrep' \ GIT_TEST_EGREP='command egrep' \ make test perhaps?