From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#66806: 30.0.50; [PATCH] 'project-find-regexp' passes Git submodules to the search program Date: Mon, 30 Oct 2023 04:00:51 +0200 Message-ID: References: <7136cdaa-25ea-17f7-396c-e217d845e837@gutov.dev> <64f0f8b9-ea72-4bba-7d90-0e6c300e6154@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38741"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: Jim Porter , 66806-done@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 30 03:02:33 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qxHbr-0009oU-8j for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Oct 2023 03:02:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qxHat-00004r-Vc; Sun, 29 Oct 2023 22:01:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qxHas-0008Vx-Dv for bug-gnu-emacs@gnu.org; Sun, 29 Oct 2023 22:01:30 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qxHas-0002yD-5j for bug-gnu-emacs@gnu.org; Sun, 29 Oct 2023 22:01:30 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qxHbO-0003Vq-L9 for bug-gnu-emacs@gnu.org; Sun, 29 Oct 2023 22:02:02 -0400 Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Oct 2023 02:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 66806 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 66806@debbugs.gnu.org, dmitry@gutov.dev, jporterbugs@gmail.com Original-Received: via spool by 66806-done@debbugs.gnu.org id=D66806.169863130313471 (code D ref 66806); Mon, 30 Oct 2023 02:02:02 +0000 Original-Received: (at 66806-done) by debbugs.gnu.org; 30 Oct 2023 02:01:43 +0000 Original-Received: from localhost ([127.0.0.1]:44106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxHb3-0003VC-SH for submit@debbugs.gnu.org; Sun, 29 Oct 2023 22:01:43 -0400 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:43293) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxHay-0003Ul-Nv for 66806-done@debbugs.gnu.org; Sun, 29 Oct 2023 22:01:40 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id C62D73200900; Sun, 29 Oct 2023 22:00:55 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 29 Oct 2023 22:00:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1698631255; x=1698717655; bh=LKjoJkLxr6pQaAJG4Qa47dQ37KYM8gh94NB N3GIuOCg=; b=DS7fCxJy8I69EqQ+RJT/bUUPG+HzKhV3xHj3YCwDpn7CfdwdxCK cT2iFQnpwUYYNZaSAcOKPesu3+I0Uennu+r3qYwTwelPDPLGrsZgB6ZDXvOmNYOh 5j+kv2wgUS0abepFKZIFSraUKDkPn0SkkgCVZu/4iEmjNhXUi+ZzMxLS1dmP21EI tykZIuOq2TbIEYgusYAOMywwBDRPJFeUPmjBa/xUYPURpawTubDRGc5UtSLJSKk8 2DISkVhON+c+Wqrruxe1El/J/Cc0v2Fe1bNURmrZpWK4KK+GPpTFH2igN48cTitX oxXiwd0wZ0QSJkIOfPtBVZxk+irKxtOzxgQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1698631255; x= 1698717655; bh=LKjoJkLxr6pQaAJG4Qa47dQ37KYM8gh94NBN3GIuOCg=; b=F DehorE/jcit5KSSD6pQNGrrr74l/p5oDqHB59JKZ8zAvokfwAuOybPi1Rzwr3HVc QUYBiD2pgGBPfHOLIiJI05wvg04LCmOncIF7eeNzAP1sYN8Er0cZ7y7oInw587A8 cM3Js6XLVUZxVEOl8J6ZRIfeoDJcD7lymPJikGqVtjET11fydEIoLyfdUXMYR2V+ TRPVISkmlGTvcI8r229skOfg7spvrEkM1mPVuTP7gHzkqRiIRYQeKbQpCaFtOscj D3lr7CxbNg/2GedAEylovgIa97nhpGBgyomLebbAnl4wl1AWCvUqHGtQzhfvWtJC RmXVbzZsUg8f2EwG4Pjrw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrleelgdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthejre dttdefjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhht ohhvrdguvghvqeenucggtffrrghtthgvrhhnpeeghedthedujeeiteeutddtjeekheejte eukeehffdutdejuedvfeevueevieduudenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 29 Oct 2023 22:00:54 -0400 (EDT) Content-Language: en-US In-Reply-To: <64f0f8b9-ea72-4bba-7d90-0e6c300e6154@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273539 Archived-At: Version: 30.1 On 30/10/2023 02:58, Jim Porter wrote: > On 10/29/2023 2:41 PM, Dmitry Gutov wrote: >> And that's not to mention usage over Tramp (which would be affected by >> the +1 process call that you mentioned as well, but that seems >> unavoidable). > > Yeah, I don't see a way around that, unless we constructed a complex > command to run via Tramp that does it all in one go. > > (I looked into using the "--stage" argument for "git ls-files", which > gets most of the way to fixing this, but you could break that logic with > evil file names not in the tree...) Filtering out gitlinks based on the mode bits? Clever. Would probably slow down the parsing of the output, though. Not sure by how much. >> Anyway, after recent experience micro-optimizing list operations, I >> came up with this version where the impact seems minimal. >> >> WDYT? > > Thanks, that helped form the basis for the attached patch. It moves the > 'member' call into the lambda for the original 'mapcar', and then we can > just 'delq' all the nil elements. Benchmarking against the Emacs repo, > this still seems to have a minimal perf impact. Ah, nice. delq is pretty handy to abbreviate the relinking. We could combine both steps to eliminate an extra list altogether, but that only yields a further 2-3% improvement. Maybe later. > There might also be a benefit to using "git ls-files > --recurse-submodules" when we can (i.e. when not using "-o"), but maybe > we can leave that optimization for another day. As long as it doesn't result in too much code duplication. Anyway, I've pushed your latest patch. Thanks! And closing.