From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 759611F47C for ; Sat, 14 Jan 2023 12:54:25 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=aueb.gr header.i=@aueb.gr header.a=rsa-sha256 header.s=201901 header.b=iq7HYdjg; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbjANMyR (ORCPT ); Sat, 14 Jan 2023 07:54:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229943AbjANMyQ (ORCPT ); Sat, 14 Jan 2023 07:54:16 -0500 X-Greylist: delayed 495 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sat, 14 Jan 2023 04:54:14 PST Received: from blade-b3-vm-relay.servers.aueb.gr (blade-b3-vm-relay.servers.aueb.gr [195.251.255.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0E27B8A4F for ; Sat, 14 Jan 2023 04:54:14 -0800 (PST) Received: from blade-a1-vm-smtp.servers.aueb.gr (blade-a1-vm-smtp.servers.aueb.gr [195.251.255.217]) by blade-b3-vm-relay.servers.aueb.gr (Postfix) with ESMTP id 0DC441CB8; Sat, 14 Jan 2023 14:45:56 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aueb.gr; s=201901; t=1673700356; bh=Pf5dFe8b1jc8Q9kT89gW6gzgwkUrQ93/ilVGTlKQ9qM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=iq7HYdjgtPxUBm4BEu8Ax2blPiFwHNgc/WP9RYRBS2u049Rm0FQsnfDlS7QQCJEVa LgFxh/wrwmt4C8Qo75rPOSVXp0OzBd5M2qX8KGugpLBSUL3FZcqFRmzyLbJ6rBj5zv QcONeUxYKGBYZAQR5Do9C8XXIE/bL7dbJ1da4NGwrnOm1ONsAAwKOpVQPl1Am4FhLu trNS5ZCiQv1PGa0Iyi+Z4CR6AhtXIKlhz+Xm1GUfPGkIw1xRfW+B8svLFFexIzm2v/ jbImMI6iNbZ8g+5wtR2uwOk9KJ0nfEROt80yHrUjTFWnJDu2S2ZVcNnPBOAyx3ETE6 YEf+ezKCuRRjw== Received: from [192.168.136.3] (ppp-94-68-109-36.home.otenet.gr [94.68.109.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dds) by blade-a1-vm-smtp.servers.aueb.gr (Postfix) with ESMTPSA id 313974C5; Sat, 14 Jan 2023 14:45:55 +0200 (EET) Message-ID: Date: Sat, 14 Jan 2023 14:45:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: BUG: git grep behave oddly with alternatives Content-Language: el-en To: =?UTF-8?Q?Ren=c3=a9_Scharfe?= , Junio C Hamano , =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Cc: Jeff King , Marco Nenciarini , git@vger.kernel.org References: <634f47a8-b370-81cb-00e7-d93ffc7534a8@web.de> <1f61b660-b2d0-ba93-3182-05a9ab97b00e@enterprisedb.com> <343a891e-d737-0ace-26a9-3839d3bd5583@web.de> <26a0d4ca-3d97-ace4-1a1f-92b1ee6715a6@web.de> <4165031d-e7f1-0477-2245-6a8e312de522@web.de> <230113.86ilhazved.gmgdl@evledraar.gmail.com> <0e25e6b0-2eb8-40ee-7999-f2863a545a15@web.de> From: Diomidis Spinellis Organization: Athens University of Economics and Business Phone: +30 210 8203621 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 14-Jan-23 10:31, René Scharfe wrote: > Am 14.01.23 um 07:44 schrieb René Scharfe: >> Am 13.01.23 um 18:19 schrieb Junio C Hamano: >>> Ævar Arnfjörð Bjarmason writes: >>> >>>> On Thu, Jan 12 2023, Jeff King wrote: >>>> There's a couple of ways out of this that I don't see in this thread: >>>> >>>> - Declare it not a problem: We have -G, -E and -P to map to BRE, ERE and >>>> PCRE. One view is to say the first two must match POSIX, another is >>>> tha whatever the platform thinks they should do is how they should >>>> act. >>> >>> ... this view. The story "BRE and ERE work via what system >>> libraries provide, and 'git grep' matches what system grep' does" is >>> an easy to understand view. >> >> That was my stance in my first reply as well. But 3632cfc248 (Use >> compatibility regex library for OSX/Darwin, 2008-09-07) explicitly >> added alternation support for BREs on macOS, and 1819ad327b (grep: fix >> multibyte regex handling under macOS, 2022-08-26) removed it seemingly >> by accident. And grep(1) does support them on macOS 13.1: Indeed, I removed the alternation handling functionality by accident. I was not aware of the BRE-handling difference between the GNU and the macOS native regex library. I think having git-grep behave the same as grep(1) on each platform is consistent with the principle of least astonishment (POLA). This would mean that on macOS plain git-grep should use enhanced basic REs as proposed in René's patch. Diomidis